> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/partner/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/partner/onboarding/integrated-onboarding/connect-button.md).

# Using Connect Button

The 360Dialog Connect Button 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 the consumer by [following this guide.](/partner/onboarding/integrated-onboarding/using-custom-io.md)

## Requirements

* [x] Redirect URL must be set in the 360Dialog Hub. [See instructions here.](/partner/partner-api/overview.md#partner-hub-redirect-url)
* [x] Partner Hub webhook URL must be set. [See instructions here.](/partner/partner-api/overview.md#partner-hub-webhook)

### Direct-Paid Accounts

Clients of [Direct-Paid partner accounts](/partner/get-started/billing-models.md#direct-paid) 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.

<figure><img src="/files/duhAKlhHt951jrKfMcOd" alt=""><figcaption><p>API key permission request screen shown to clients of Direct-Paid partner accounts</p></figcaption></figure>

## Implementation

{% stepper %}
{% step %}

### Use the connect button

There are two ways to use the 360Dialog Connect Button:

* This [**Demo App**](https://integrated-onboarding-demo.vercel.app/) can be used. Just fill in the partner ID and copy the button or link:&#x20;

<figure><img src="/files/j986nhSmG1t9Qx5FV9Us" alt=""><figcaption></figcaption></figure>

* Or include a script tag on your page:

```
<!-- unpkg -->
<script src="https://unpkg.com/360dialog-connect-button/dist/dialog-connect-button.umd.js"></script>
<!-- jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/360dialog-connect-button/dist/dialog-connect-button.umd.js"></scri
```

{% hint style="info" %}
**With /** **Without IO Signature**

The button can be configured to use [IO Signature, a new **optional** security feature](/partner/onboarding/integrated-onboarding/io-signature.md) 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.](/partner/onboarding/integrated-onboarding/io-signature.md)

***

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.
{% endhint %}

{% tabs %}
{% tab title="Without IO Signature" %}

```javascript
<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/360dialog-connect-button/dist/dialog-connect-button.umd.js"></script>
  </head>
  <body>
    <dialog-connect-button
      partner-id="YOUR_PARTNER_ID"
      label="Connect WhatsApp Business"
    ></dialog-connect-button>
    <script>
      window.addEventListener('dialog-connect-callback', event => {
        console.log('client ID:', event.detail.client);
        console.log('channel IDs:', event.detail.channels);
        console.log('revoked channel IDs:', event.detail.revokedChannels || []);
      });
    </script>
  </body>
</html>
```

{% endtab %}

{% tab title="With IO Signature" %}

```javascript
<dialog-connect-button
  id="connectBtn"
  partner-id="YOUR_PARTNER_ID"
  label="Connect WhatsApp Business"
></dialog-connect-button>
<script>
  // Fetch a fresh signature on page load
  fetch('https://your-server.com/api/sign_io')
    .then(res => res.json())
    .then(payload => {
      const btn = document.getElementById('connectBtn');
      btn.setAttribute('io-signature', payload.signature);
      btn.setAttribute('io-timestamp', payload.timestamp);
    });
  window.addEventListener('dialog-connect-callback', event => {
    console.log('client ID:', event.detail.client);
    console.log('channel IDs:', event.detail.channels);
  });

```

{% endtab %}
{% endtabs %}

{% endstep %}

{% step %}

### 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                     | 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 |

{% endstep %}

{% step %}

### Handle Webhooks

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

* `channel_created`: [Sent when a new WhatsApp channel is created](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#channel-created)
* `channel_status_running`: [Sent when the channel status changes](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#channel-running)
* `phone_number_quality_changed`: [Sent when the messaging limit changes](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#quality-rating-event)
  {% endstep %}

{% step %}

### 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.

Please use this [endpoint](/partner/partner-api/api-reference/channel-management.md#post-api-v2-partners-partner_id-channels-channel_id-api_keys).

{% hint style="info" %}
**Reminder for** [**Direct-Paid partners**](https://docs.360dialog.com/partner/get-started/billing-models#direct-paid)

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](https://docs.360dialog.com/partner/partner-hub/api-keys) for details.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.360dialog.com/partner/onboarding/integrated-onboarding/connect-button.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
