For the complete documentation index, see llms.txt. This page is also available as Markdown.

Using Connect Button

This page describes how to use the 360Dialog Connect Button React package to trigger Integrated Onboarding

The 360Dialog Connect Button is a React Node.js package that simplifies Integrated Onboarding (IO). The button is customizable and, when clicked, triggers the Integrated Onboarding flow. It also simplifies handling the post-IO-flow redirect.

Partners using a different UI library or framework, or preferring their own implementation, can create their own Integrated Onboarding trigger and redirect consumer by following this guide.

The following demo/generator site can be used to practice consuming IO redirects:

Requirements

Direct-Paid Accounts

Clients of Direct-Paid partner accounts will see a price detail and payment information page between the Account Creation and Embedded Signup steps.

The client needs to grant API key permission before the partner can generate an API key for them. Clients can give this permission during the Integrated Onboarding flow (pictured below), or in the 360Dialog Hub after onboarding.

API key permission request screen shown to clients of Direct-Paid partner accounts

Implementation

2

Add Button Component

With / Without IO Signature

The button can be configured to use IO Signature, a new optional security feature that prevents clients from onboarding phone numbers without authorization from the partner/partner platform.

It requires a server-side implementation, and IO Signature must be enabled in the 360Dialog Hub. See implementation instructions here.


Partners preferring a quicker start can use the 360Dialog Connect Button without using the IO Signature feature.

Code examples for both approaches (with and without IO Signature) are shown below.

Import the ConnectButton component from the 360dialog-connect-button package.

Implement the component like in the example below.

3

Consume Redirect

After completing onboarding, clients are redirected to the partner's configured redirect URL. The following query parameters are added to the redirect URL:

Parameter in query
Component callback prop
Description

client=<client-id>

CallbackObject.client

ID of the client who was redirected to the partner's redirect URL.

channels=[<channel-id>,<channel-id>]

CallbackObject.channels

Comma-separated array of channel IDs (a.k.a. phone numbers) the partner has permission to generate an API key for

revoked=[<channel-id>]

CallbackObject.revokedChannels

OPTIONAL - may not be present in every redirect.

Comma-separated array of channel IDs (a.k.a. phone numbers) the client has revoked partner's API key permissions for

The 360Dialog Connect Button simplifies these queries' parsing and handling if it is present/mounted in the partner's configured redirect URL. The function passed in the component's callback property is called after the client is redirected from Integrated Onboarding to the partner's redirect URL page.

If the 360Dialog Connect Button is present and mounted in the redirect URL page, proceed to the next step.

If it is not possible to mount the component on the redirect URL page, use the following JS code in the redirect URL page to replicate the 360Dialog Connect Button's handling behavior:

Manually handling redirect query parameters

Manually handle query parameters passed in the redirect URL:

Then close the pop-up window (if it hasn't closed automatically):

4

Handle Webhooks

After completing onboarding, the partner's webhook URL endpoint will receive the following important status events:

5

Generate API Key

When the channel reaches running status, create an API key for the newly-onboarded phone number to begin sending messages with this phone number.

Store the returned API key securely - it cannot be retrieved later.

Reminder for Direct-Paid partners

Partners on the Direct-Paid billing plan must receive API key permission from their client before being allowed to generate an API key for the client's phone number.

Clients are asked during onboarding if they want to grant API key permission. They can also grant API key permission later in the 360Dialog Hub.

See Partner Permissions for details.

Last updated

Was this helpful?