Custom Integrated Onboarding
The Custom Integrated Onboarding allows you to trigger the singup experience to clients on your own development requirements.
Requirements
Set Redirect URL
Set Partner Hub Webhook URL and listen to Webhook Events
If you are using Direct Payment
When using Direct Payment, your Integrated Onboarding experience will show a price detail and payment information page between the Account Creation and Embedded Signup steps.
You will also be required to get permission from the client to be able to generate an API key. The permission can given during the Integrated Onboarding flow or in the Client Hub.
Building the Integration
Step 1: Ensure requirements are met
Step 2: Build your own custom flow on any development language you choose
If you choose to build your own custom flow instead of using the React.js button component provided in the Basic Integrated Onboarding, here are the general guidelines.
If you have multiple 360dialog Partner Hubs (one for Partner Payment and one for Direct Payment, for example), you can create different buttons for each Hub and show them to users accordingly.
Step 3: Call /permissions
screen
/permissions
screenExample:
The code block below shows an example including explanations (your implementation may differ). You can initiate the Integrated Onboarding Flow with the function open360DialogPopup(window.location.origin)
(remember that your implementation may differ):
Step 4: Consuming redirect
After the client signed in or up and granted permission to one or multiple phone numbers, your redirect URL is being called with query parameters:
Parameter in query | Description |
---|---|
client=<client-id> | Client ID |
channels=[<channel-id>,<channel-id>] | Array of channel IDs, that were being permitted during the last call to the permission page |
revoked=[<channel-id>] | OPTIONAL In case the client removes permissions to one or multiple numbers during the most recent call to the permission page, the channel IDs of the newly revoked channels will be present in the query |
See the full list of possible URL Parameters here.
Usually the newly opened popup window should close automatically if the Redirect URL matches the calling window’s URL. It will pass the query parameters to the calling window, where these can be retrieved by using the addEventListener()
method together with the Window
target:
To retrieve the parameters from the query string, e.g. ?client=oaY9LLfUCL&channels=[y9MiLoCH]
, the browser’s get()
method of the URLSearchParams interface can be used.
If the newly opened popup window won't close after the redirect call (if redirect is the same as parent window URL), you can add a function that is executed on window.onload
, ensuring that the parameters are processed only after the page has finished loading:
Step 5: Listen to Webhook Events to understand status of the Channel
If the number was successfully registered, you will receive a webhook event indicating a new Channel Created. See details here. This does not mean the Channel is fully live. Other webhook events will indicate the current status of the number.
You won't be able to generate an API key unless the channel status is running.
You can also see the number and details in your Partner Hub dashboard or use the Partner API to retrieve this information.
Step 6: Create API key to start messaging
If you have the permission to do so, you should generate an API Key and connect it to your integration to start messaging with this phone number.
See Partner Permissions for details.
Last updated