> For the complete documentation index, see [llms.txt](https://docs-en.dydu.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-en.dydu.ai/integration/channels/connector/meta/whatsapp.md).

# WhatsApp

## **Prerequisites**

To make your **Dydu bot** available on **WhatsApp**, you must have the following:

* A **Meta application** created from the **Meta for Developers** interface.
* The **WhatsApp application** installed on your **phone** or **computer**.
* A **phone number** dedicated to **bot testing**.

## **Step 1: Add the necessary products for WhatsApp**

To make your **application** work on **WhatsApp**, you need to **add** and **configure** the following **products**:

* **Facebook Login for Business**
* **WhatsApp**

#### **Procedure:**

1. Click on **“Add a product”** in the **Meta for Developers** interface.

<figure><img src="/files/S4upfA0BSilS45TNGkT6" alt="" width="212"><figcaption></figcaption></figure>

2. Search for the **“Facebook Login for Business”** product and click **“Set Up”**.

<figure><img src="/files/zi9jTrYYdaKKiwz5drpb" alt="" width="251"><figcaption></figcaption></figure>

3. The **Settings page** for **Facebook Login for Business** will open, and a new **“Facebook Login for Business” section** will appear in the **left-hand menu**.

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

4. Go back to the **Products page** by clicking **“Add a product”**.
5. Search for **“WhatsApp”** and click **“Set Up”**.

<figure><img src="/files/KAyVccGlEhE1eCc07xcZ" alt="" width="246"><figcaption></figcaption></figure>

6. The **Settings page** for the **WhatsApp** product will open, and a new **“WhatsApp” section** will appear in the **left-hand menu**.

<figure><img src="/files/4Myr8UBhlJW0ISbDG4rN" alt=""><figcaption></figcaption></figure>

Your **products** have been **successfully added**! We will now proceed with their **configuration**.

### **Configure the Facebook Login product**

#### **Procedure:**

1. Click on **Facebook Login for Business > Settings**.

<figure><img src="/files/nZXZdPViJZ1l2QlrZavD" alt="" width="221"><figcaption></figcaption></figure>

2. Enable the option **“Login with the JavaScript SDK.”**
   * This option allows you to **sign in to your Facebook account** from the **integration in Dydu’s Channels menu**.

<figure><img src="/files/wP4ZJUagDwuzg3ldykZs" alt="" width="563"><figcaption></figcaption></figure>

3. Fill in the field **“Allowed Domains for the JavaScript SDK”** with the **main URL** of your **Channels menu**.
   * The **URL** can be found in the **web inspector console** (accessible with **F12**) when loading the **Channels menu**, and it should look like this:

> <https://sso.channels.dydu.ai/>

### **Configure the WhatsApp product**

#### **Procedure:**

Before adding your bot’s **final phone number** and generating a **permanent access token**, start by validating the configuration with a **test number** provided by **Meta** and a **temporary access token**.

To do this:

1. Click on **WhatsApp > API Setup**.

<figure><img src="/files/Jv8NhYjNwbxOIWhn0cMv" alt="" width="226"><figcaption></figcaption></figure>

2. To add a **test number**, go to **Step 1: “Select phone numbers.”**

<figure><img src="/files/GVEplFpcbsQgIJ0vqi9u" alt="" width="563"><figcaption></figcaption></figure>

3. Click on the **“From” dropdown menu.**

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

4. Choose the **test number** provided by **Meta** (**“Test Number”**).
5. Click on the **“To” dropdown menu.**

<figure><img src="/files/0281dbJWQE2Ahl1RGCtK" alt=""><figcaption></figcaption></figure>

6. Choose a **phone number** from the list. If no number is available, you can add one by clicking **“Manage phone number list.”**

You can now move on to the next step: **create and configure a Meta integration** from the **Channels menu** in **Dydu’s BMS**.

## **Step 2: Configure WhatsApp from the Channels menu in Dydu’s BMS**

To create a **Meta integration** in **Dydu’s BMS**, follow these steps:

* Obtain your **Meta application ID** and its corresponding **key**.
* Obtain your **bot’s phone number ID** and its **access token**.

This information is specific to your **Meta application** and is available on your **Meta for Developers portal**.

### **Find your Meta application ID and key**

1. In the **Meta for Developers** portal, open your **application**, then click **Settings > General** in the **left-hand menu**.
2. Copy and keep your **application ID**.
3. Click the **“View”** button to display your **application key** — you will be asked to **enter your password** to view it.
4. Copy and keep your **application key** safely.

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

### **Find the phone number ID and access token**

1. Click on **WhatsApp > API Setup** in the **left-hand menu**.
2. Locate the **“Access Token”** section.
3. Copy and keep this **token**.

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

4. Go to **Step 1: “Send and receive messages.”**
5. Under your **phone number**, you’ll find the **“Phone Number ID.”** Copy and keep this **value** securely.

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

### **WhatsApp configuration in Channels**

With this information, **log in** to your **Dydu BMS** and open your bot’s **Channels menu**.

If you already have a **Meta-type integration**, go directly to **Step 9**.

1. Select the **Meta platform**.

<figure><img src="/files/QPgNj9A66DlsUwzUog7o" alt="" width="563"><figcaption></figcaption></figure>

3. Give a **name** to this **integration** and click **“Create.”**
4. You’ll arrive on the **“Information”** page, where you can select the **language** and the **space** that will be used by your **bot on WhatsApp**.

<figure><img src="/files/gqAbtH6phTyZ1WCKjoQp" alt="" width="563"><figcaption></figcaption></figure>

5. Copy and keep the **endpoint**
6. Click the **“Next”** button.
7. A **modal window** will open — enter your **Meta application ID** and **application secret key**.

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

{% hint style="info" %}
These **details** were previously retrieved from your **Meta for Developers** portal.

If you skipped that step and don’t know how to find your **application ID** and **secret key**, we explain it [**here**](#find-your-meta-application-id-and-key)!
{% endhint %}

8. Once the information is provided, click **“Save.”**
9. You’ll be redirected to the **“Connection”** page.
10. On the left, you’ll see the **available connections**. Click **“Create”** next to **WhatsApp** to **connect your Dydu bot** to your **WhatsApp account**.

<figure><img src="/files/eC7ghe3f4Wzk9Rb6bRux" alt="" width="332"><figcaption></figcaption></figure>

11. A **new tab** will open asking you to **log in**.
12. **Log in** and **confirm**.
13. You will then be **redirected** to your **integration configuration** in the **Channels menu**. A **“WhatsApp” modal** will appear.

<figure><img src="/files/ilTzIHQDaDL2X4moKNQW" alt="" width="375"><figcaption></figcaption></figure>

11. Check for which elements you require access authorization and click on “Save”
12. A message confirming the association of your WhatsApp account with your Meta integration is displayed: click on the “I understand” button.
13. You are then redirected to the configuration of your integration from the Channels menu. A “WhatsApp” modal is opened.
14. Fill in the **phone number ID** and the **access token**.

{% hint style="info" %}
These details were previously retrieved from your **Meta for Developers** portal.

If you skipped that step and don’t know how to find your **page ID** and **access token**, we explain it [**here**](#find-the-phone-number-id-and-access-token)!
{% endhint %}

15. Click **“Update.”**
16. Your **WhatsApp connection** is now set up!
17. Click **“Finish.”**

Your **bot** is now **available on WhatsApp**, but it is only **accessible** to the **phone numbers** you added during the **WhatsApp product configuration** in your **Meta for Developers portal**.\
Additionally, the **token** generated is **valid for 24 hours** after its creation (it can be **renewed** as many times as needed).

To make your bot **available to all WhatsApp users** without any time limitation, you must:

* Add your **own WhatsApp phone number**,
* Generate a **permanent token**.

## **Step 3: Use WhatsApp with your own configuration**

### **Add your own phone number**

1. Go back to the **Meta for Developers** interface.
2. To add your **phone number**, go to **WhatsApp > API Setup**.
3. Go to **Step 5: “Add a phone number”** and follow the instructions.

<figure><img src="/files/1QMM6jdGqj04Y1zTwn72" alt=""><figcaption></figcaption></figure>

4. Go to **Step 6: “Add a payment method”** and follow the procedure.

{% hint style="info" %}
Since **business-initiated conversations** are **paid**, you’ll be asked to provide a **payment method**.

**Meta** provides detailed **pricing conditions** on its website. To learn more, please visit the **dedicated page** on **Meta’s official site**.
{% endhint %}

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

### **Generate a permanent token**

Click on **App Control > Permissions and Features** in the **left-hand menu**.

<figure><img src="/files/KTZrsEi3OUONu9EiGw8j" alt="" width="218"><figcaption></figcaption></figure>

To create a **permanent token**, **Meta** provides **online documentation** explaining all the necessary steps — you can find it [**here**](https://developers.facebook.com/docs/whatsapp/business-management-api/get-started#1--acquire-an-access-token-using-a-system-user-or-facebook-login).

Once these **permissions** are granted, you can switch your **application** to **“Live” mode**.
