# 2) Module's Configuration

Follow the steps below to finalize the connection of the app you created in step 1) with Perfex CRM, allowing it to send and receive WhatsApp messages directly from your CRM interface. <br>

***

## ⚙️ Connection Settings Tab

<figure><img src="https://1716777396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8RAnu4FDDi19J83WzSNX%2Fuploads%2FgjCU2Kdi6hphMviV4tA0%2Fimage.png?alt=media&#x26;token=f70a235b-dba9-4b2f-be45-3efefa29b78c" alt=""><figcaption><p><br></p></figcaption></figure>

***

### 🛠️ Steps to finalize the connection:

1. **Get Your Business ID and Access Token**\
   You’ll find your Business ID in Meta Business Manager and create a long-lasting Access Token from the Developer Dashboard (you created them previously, following 1a guide).
   * 🔗 [Find your Business ID](https://business.facebook.com/settings/info)
   * 🔗 [Generate a System User Access Token](https://developers.facebook.com/blog/post/2022/12/05/auth-tokens/)<br>
2. **Paste your credentials** (created from the first step of this guide) into the CRM settings:
   * 📱 Business ID
   * 🔑 Access Token
   * 🆔 Meta App ID
   * 🛡️ App Secret
   * 🔐 Webhook Token (you defined this during Meta's App creation)<br>
3. **Click “Save Settings”** to store the values safely in Perfex CRM.<br>
4. **Click “Connect”**\
   This will verify your credentials and automatically fetch your WhatsApp Business Account ID, phone numbers, and current webhook status.
   * ✅ Confirms your access token is valid
   * 📦 Loads your WABA and linked phone numbers<br>
5. **Register Webhooks (Optional)**\
   If you've entered your App ID and App Secret, click “Register Webhook” to start receiving real-time WhatsApp messages in your CRM.

   * 🔔 Enables incoming message notifications
   * 📥 Delivers read receipts, status updates, and more
   * 🔗 [Webhook Setup Guide](https://developers.facebook.com/docs/graph-api/webhooks/getting-started#setup)
   * 🔗 [WhatsApp Webhook Reference](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/)<br>

Notes:

* If your Meta App ID and App Secret are provided, the webhook will be registered automatically via Meta’s API. If not, you can register it manually in the Meta Developer Console.
* Your Access Token must come from a **System User** with the correct permissions: `whatsapp_business_management` and `webhooks`.\ <br>

***

🟢 What the Buttons Do

* **Save Settings** – Stores your credentials in Perfex CRM securely.
* **Connect** – Validates your access token and fetches WABA and phone info.
* **Disconnect** – Deletes all saved Meta credentials and disables the sync.<br>

#### ✅ Tips for a Smooth Setup

* Use a **long-lived token** (valid for 60 days or more).
* Make sure your **Webhook URL** and **Webhook Token** match exactly in Meta Developer settings.
* Click **Connect** after saving to verify everything is working.
* **Keep your App Secret and Access Token safe**. Never share them or expose them to users.

***

## 🎯 Horraay!&#x20;

## You’re done with the complete configuration.

At the end of a successful connection, you will see a screen similar to this:

<figure><img src="https://1716777396-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8RAnu4FDDi19J83WzSNX%2Fuploads%2FPqd5y8xUngl7wFdYgPHZ%2Fimage.png?alt=media&#x26;token=d68c259f-60ab-4eca-97ca-73a01627d636" alt=""><figcaption></figcaption></figure>
