# WhatsApp Messages

## 📱 WhatsApp Integration in Teloai

You can hook up WhatsApp messaging in Teloai in two ways:

1. **Via Twilio** (live today)
2. **Direct WhatsApp Business API**

***

### 🛠 Method 1: Twilio WhatsApp Sender

Teloai’s current WhatsApp channel uses Twilio’s Programmable Messaging for WhatsApp. You’ll need a Twilio‐approved WhatsApp sender.

| What you’ll collect from Twilio                             |
| ----------------------------------------------------------- |
| • **WhatsApp Sender** (E.164, e.g. `whatsapp:+14155238886`) |
| • **Twilio Account SID** (`AC…`)                            |
| • **Twilio Auth Token** (secret)                            |
| • *(Optional)* Messaging Service SID                        |

#### Steps

1. **Register your WhatsApp Sender**
   * Log in to the Twilio Console → Messaging → Senders → WhatsApp Senders [twilio.com](https://www.twilio.com/docs/whatsapp/getting-started?utm_source=chatgpt.com)
   * Choose **“Senders” → “WhatsApp Senders” → “Self Sign‑up”**.
   * Follow the prompts to create/validate your WhatsApp Business Profile and connect your phone number.
2. **(Optional) Add to a Messaging Service**
   * In Twilio Console → **Messaging → Services**, open or create a Service.
   * Under **Senders**, click **Add Senders** → select your WhatsApp number.
3. **Grab your credentials**
   * **Account SID** & **Auth Token**: Console top‑right avatar → **Account → General Settings**.
   * **WhatsApp Sender**: Console → **Active Senders → WhatsApp** → copy the full `whatsapp:+` number.
   * **Messaging Service SID** (if used): Console → **Messaging → Services** → copy SID.
4. **Configure in Teloai**
   * In Teloai Dashboard → **Channels → Create → WhatsApp by Twilio**.
   * Paste each value into the form:
     * **WhatsApp Number**
     * **Account SID**
     * **Auth Token**
     * **Messaging Service SID** (optional)
     * **Label** (e.g. “Support WA”)
   * Click **Save**.
5. **Test a message**
   * In Teloai → **Channels → WhatsApp** → **New Message**.
   * Send to your personal WhatsApp and confirm delivery.

***

### 🔮 Method 2: Direct WhatsApp Business API

Teloai plans to offer a built‑in integration directly against Meta’s WhatsApp Business API. At launch, you’ll supply:

| Required from Meta’s WABA Portal                  |
| ------------------------------------------------- |
| • **WABA ID** (your WhatsApp Business Account ID) |
| • **Phone Number ID**                             |
| • **Permanent API Access Token**                  |
| • **API Base URL** (Graph endpoint)               |

#### High‑Level Flow

1. **Set up WABA & Business Verification**
   * In Facebook Business Manager: verify your business, create a WABA, and register your phone number.
2. **Generate API creds**
   * In Meta for Developers → **Business Settings → WhatsApp Accounts**
   * Copy your **WABA ID**, **Phone Number ID**, and **Access Token**.
3. **Configure in Teloai**
   * Go to **Channels → Create → WhatsApp (Direct API)**
   * Enter:
     * **WABA ID**
     * **Phone Number ID**
     * **API Access Token**
     * **API URL**
     * **Label**
   * Click **Save**.
4. **Send & Receive Messages**
   * Use Teloai’s “New Message” wizard—no code needed.

> **Note:** Direct API mode bypasses Twilio, letting you message at higher scale and lower cost once supported.

###
