C
C
Connectivity Platform
Ask or search…
K

Set up an identity verification process flow with the Analyze Image step

The Know Your Customer (KYC) process is often used by companies that need to verify a customer’s identity.
In this guide, you’ll learn how to set up your KYC process using the Analyze Image step in Flow Builder.
We’ll show you how to build a flow that asks the user for a photo of their passport, extracts the relevant KYC data, and stores it in a safe location so that it can be reviewed and verified by you.
Before you start, make sure that you’re familiar with the image quality best practices.

Privacy & data protection

If you're extracting sensitive information from an image, such as details from a passport for the purposes of identity verification, you need to make sure that you're following a proper privacy policy.
You are responsible for and must secure all necessary notices, permissions, and consents to collect, use, and share people's content and information, including maintaining a published privacy policy, and otherwise complying with applicable law.
Check out the WhatsApp Business Policy for specific WhatsApp usage guidelines.

Requirements

Step one: Insert the Analyze Image step

  1. 1.
    Go to the flow that you want to use, or set up a new flow.
  2. 2.
    Add the Analyze Image step under the flow’s trigger.
  3. 3.
    Go to the step’s settings on the right-hand side of the screen.
  4. 4.
    In the Image URL field, enter {{messageImage}}. When a user sends an image from their smartphone, that image will be made available in the flow at the URL contained in the {{messageImage}} variable.
  5. 5.
    In the Image content to recognize field, select Document from the drop-down menu.
  6. 6.
    In the Document type field, select Passport from the drop-down menu.
  7. 7.
    In the Output variable field, enter image_content. This specifies the output variable that will carry the payload that the step recognizes.
  8. 8.
    Click Save!

Step two: Check if the passport extraction was successful

If the Analyze Image step was unable to successfully extract passport data, you’ll probably want the user to upload another image. To do this, follow these steps:
  1. 1.
    Add a Branch below the Analyze Image step.
  2. 2.
    Go to the branch settings on the right-hand side of your screen. Select Custom condition from the drop-down menu.
  3. 3.
    Under the If… condition that appears, enter {{image_content}}, or drag and drop the image_content parameter into the first field.
  4. 4.
    From the drop-down menu below, select is empty or not set, then click Save.
  5. 5.
    Add a Reply to channel message step below the image content branch that you just set up.
  6. 6.
    Go to the step settings on the right-hand side. Select Text from the Message type drop-down menu, then add a helpful message to the Reply with message field. This message aims to get the user to send a new photo so that the text can be extracted!
  7. 7.
    Add a Wait for a response step below the Reply to channel message step that you just set up.
  8. 8.
    Go to the step settings on the right-hand side. Select how long you want to wait for a response.
  9. 9.
    In the Response variable name field, enter a recognizable value, such as passport_response, then click Save.
  10. 10.
    Add a Set variables step below the Wait for a response step that you just set up. This step will set the incoming_message variable to be equal to the variable that will store their response.
  11. 11.
    Go to the step settings on the right-hand side. In the Name field, enter incoming_message.
  12. 12.
    In the Value field, enter {{passport_response}}, or drag and drop passport_response from the available variables, then click Save.
  13. 13.
    Finally, add a Jump to step below the Set variables step you just set up. This step will funnel any responses to the Reply to channel message step back to the Analyze image step so that the flow can try to detect and extract text from the user’s new photo.
  14. 14.
    Go to the step settings on the right-hand side. Click Pick step to jump to, then click the Analyze image step in your flow.
  15. 15.
    Optional: Choose how many times you want this jump to be repeated per customer. By default, the number of jumps is set to 250, giving your customer 250 attempts to upload a suitable photo of their passport!
  16. 16.
    Click Save to save the step.

Step three: Store the extracted data in a Google Sheet

  1. 1.
    Create a Google Sheet with the following columns:
    • First name
    • Last name
    • Nationality
    • Gender
    • Personal number
    • Date of birth
    • Passport number
  2. 2.
    Add an Add row in Google Sheets step under the Else branch.
  3. 3.
    Go to the step settings on the right-hand side. Click on Select Google Sheet.
  4. 4.
    In the pop-up window, locate your Google Sheet by selecting your Google Account, Google Drive, Google Sheet document, and Tab/Worksheet name.
  5. 5.
    Click Save settings. The names of the columns in your Google Sheet will appear in the step settings on the right-hand side of your screen.
  6. 6.
    Starting with Column A - First Name, or drag and drop the image_content variable into the field.
  7. 7.
    Click on the curly brackets and select first_name from the options that appear. The field should now look like this:
  8. 8.
    Repeat this step for the other fields in the settings, making sure that you add the corresponding addition to each image_content variable, as shown in the image below.
  9. 9.
    Click Save to save the step
  10. 10.
    Add a Reply to channel message step below the Add row in Google Sheets step you just set up.
  11. 11.
    Go to the step settings on the right-hand side. Select Text from the Message type drop-down menu, then add a message to the Reply with message field, letting the user know that their image upload has been successful.
  12. 12.
    Click Save to save the step
  13. 13.
    Finally, add the End of flow step to the end of the flow to complete
  14. 14.
    Publish your flow.
This is what your completed flow should look like. Go ahead and test your flow! 🎉