Setting up the WhatsApp Embedded flow
Last updated
Was this helpful?
Last updated
Was this helpful?
To onboard your customers onto WhatsApp, you will need to integrate the WhatsApp embedded flow into your own platform. This enables your customers to share permissions for you and Bird to manage their WhatsApp business account and send messages on their behalf. Customers share permissions by logging in through the embedded signup flow.
See the following from Meta on how to complete this. When embedding the signup flow, there are two important extra data fields (as shown in the extras.setup
object below) that must be set correctly:
Solution_Id: This should be set to the solutionId
obtained after you . This ensures that your end customer is onboarded for both your business and allows Bird to send messages on behalf of this customer
Preverified_Id: If you’ve for your customer, it will already be pre-verified (authenticated) for WhatsApp. Including the preverified_id
when launching the signup flow enables the customer to onboard without needing to receive an OTP code for the number. See the instructions below on how to obtain the
For the embedded signup to work, you must apply for advanced access to the public_profile permission on your Meta app. In the Meta for developers app dashboard, navigate to your App Review > Permissions and features are ensure you have advanced access as shown
If you have purchased a number for your customer through Bird CRM, this should be automatically pre-verified for use on WhatsApp. This typically takes around 5 minutes from completing the number purchase. To list the numbers in your workspace you can list them as follows
To get the pre-verified number ID check the number.whatsApp object as follows. You should make use of the whatsAppId.
In addition before starting the embedded flow ensure that:
status: verified
stage: final
verificationExpiresAt is after now
Once the embedded signup has been completed and you have the phone_number_id, waba_id, and code you should submit this to an api endpoint e.g. <somedomain>/installwhatsapp. In addition if you are using a number bought via Bird then you should also include the unique id of the number
You should securely associate the long lived token and WABA ID with the customer account in your platform.
You should also implement to get the phone_number_id and waba_id after the user completes the embedded signup.
Once your customer has completed the embedded signup, you should collect the phone_number_id and waba_id from the object
In addition you should get an object which will contain a token which will be exchanged for a long lived access token
From this API you can then you have a long lived access token. You should use the Meta App_ID and App_Secret from the app you created earlier.
Retrieve a specific number details by its ID. This number is part of the workspace purchased number inventory.
The ID for the workspace.
d386a801-ee8d-4aba-a7e4-78671bd3b11e
The number/endpoint ID.
e40ce70f-e7e0-45c0-9d64-2fc7d0401a16