WhatsApp Guide

WhatsApp can be used as a channel to reach users using Digital Identity Flows you have created. Using a WhatsApp Business Account (WABA), you would be able to send and receive messages through the Whatsapp Business API for your business processes and interactions with your users, each input needed for the Verification Flow is requested and users are guided through each step until completion.

Whatsapp integration example

Preparing your Whatsapp Business Account

Our team will guide you through the WABA creation process. It will belong to your company but will be managed by us to ease the configuration process. For additional information on setting up your WhatAapp business channel follow this guide.

Start a Flow with Inbound messages.

An inbound message is any message that the user sends to the WABA. A user can start a Verification Flow by sending a specific inbound message you have configured for a WABA. This can be done by creating a link that you can set in your landing page, media campaigns or app buttons. Once the user opens the link, a WhatsApp chat with your WABA will open with the message you have configured, starting the verification process. Try it out here.

To set up your Flow with inbound messages, follow these steps:

  1. Create a Verification Flow with the steps you want the user to follow. If you already have a Flow created, copy the FlowID that identifies the Flow.
  2. Create the Inbound Flow

  3. Create a POST request to https://api.identity.truora.com/v1/whatsapp/inbounds

  4. Create a Header named Truora-API-Key and set its value to your API key.
  5. Set the value for Content-Type header as application/x-www-form-urlencoded.
  6. Create the following keys in the application/x-www-form-urlencoded request body and set their respective values as follows:

    • waba_phone_number: phone number of the WABA that will be interacting with the users. Must include the country code.
    • waba_provider: name of the provider for the WABA. Only GUPSHUP is supported.
    • flow_id: identifier of the Verification Flow previously created.
    • inbound_message: unique message the users will be sending to the WABA in order to begin the Verification Flow.
  7. Create a short link that starts the WhatsApp conversation using a tool like https://crear.wa.link or the internal shortener. The content of the message must be the one you specified as inbound_message in the request of the previous step.

Start a Flow by contacting your users through Outbound messages [BETA]

Outbound messages are messages sent directly to the users without any previous interaction with your business WABA. For this to be possible, two things are required.

  1. An explicit permission needs to be granted by the user to your business, allowing you to contact them through Whatsapp for business purposes. This is called an opt-in. For more guidance on how to obtain it, visit this link.
  2. The message you use to start the interaction with the users needs to be approved by WhatsApp, making sure you comply with the minimum requirements and guidelines to prevent user spam, fraud and other policies. For this, contact us and we will help you with the process.

Once you have the user opt-in and a message template approved for outbounds, send a request to our API to send the message to the users and start with the Flow.

  1. Create a POST request to https://api.identity.truora.com/v1/whatsapp/start-conversation
  2. Create a Header named Truora-API-Key and set its value to your API key.
  3. Set the value for Content-Type header as application/x-www-form-urlencoded.
  4. Create the following keys in the request body and set their respective values as follows:

  5. phone_number: phone number without the country code of the user that will receive the message.

  6. country_code: country code of the phone number. Here you can find a complete list of country codes.
  7. outbound_flow_id: ID of the outbound Flow to be used in the outbound message.
  8. user_authorized: indicates whether the person who owns the phone number provided has authorized the process by giving the opt-in directly to you. Must be true in order to continue.

  9. Send the request. If all previous steps were followed properly, the user should now receive the outbound message you configured, allowing them to start the Verification Flow.

Receive results of the users that went through the Flow

Results are reported using the same hooks configured for the Digital Identity product. For more information, check the Setting up Hooks guide. The information in the hook contains the results of the validations made to the user, such as liveness verification, and also the responses to custom questions you have set up in the Flow. Be aware that hooks will be sent for all the Identity Verification processes made through all platforms (web, SDK, WhatsApp). If you want to receive only for a specific platform, you might want to use different FlowIDs for each one, and manually filter them once they arrive.

If you want to receive hooks only for processes finished successfully, you need to create the hook and listen only to the succeeded event. Otherwise, you can listen to both, succeeded and failed, if you want to keep the information to use in some kind of user re-engagement process in the future.