Coxcox AI is an agent designed to perform telemarketing work
To connect and manage messages for WhatsApp Business accounts of other companies through your backend, the Cloud API provided by Meta is the best option:
Documentation: WhatsApp Cloud API
- Hosted by Meta: No need for self-hosting or maintenance.
- Messaging Functions: Provides direct access to send/receive messages, templates, and media.
- Ideal for Customer Support: Supports quick setup and scalability.
- Cost: Based on usage but simplifies real-time, AI-driven messaging integration.
For an application that manages conversations via WhatsApp Business for customer service, the Cloud API is specifically designed for this purpose, making it efficient and easy to implement.
To use the Cloud API, you must have a Business Portfolio.
A Business Portfolio serves as a container for your WhatsApp Business Accounts (WABA) and associated business phone numbers.
When completing the initial setup as described in the Getting Started guide, a test WABA and business phone number are automatically created.
You can delete your Business Portfolio and its test resources under these conditions:
- You are the administrator of the associated Business Portfolio.
- No other apps are associated with the Business Portfolio.
- The Business Portfolio is not associated with any other WABA.
- The WABA is not associated with any other business phone number.
- Go to the App Dashboard > WhatsApp > Settings.
- Locate the Test Account section.
- Click the Delete button.
The Cloud API uses the Graph API Versioning Protocol. This means:
- All endpoint requests must include a version number.
- Each version remains available for approximately 2 years before being deprecated.
The API supports the following types of tokens:
- System User Access Token
- Business Integration System User Access Token
- User Access Token
For more information, refer to the official guide: Access Tokens
The Cloud API requires the following Graph API permissions. The exact combination depends on the endpoints your app needs to access:
business_management: Required to interact with a Business Portfolio.whatsapp_business_management: Required to interact with a WABA, its stats, templates, or business phone numbers.whatsapp_business_messaging: Required to send and receive WhatsApp messages.
Webhooks allow you to receive real-time HTTP notifications about changes to specific objects.
In WhatsApp, webhooks can notify you about events such as:
- Message delivery and read notifications.
- Account-level changes.
Once you migrate a phone number to the WhatsApp Business Platform, you cannot use it with the WhatsApp Business App.
Meta Apps Limitation: Only one endpoint can be configured per Meta app. If you need to send webhook notifications to multiple endpoints, you must use multiple Meta apps.
Incoming Webhook Example:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "500456646489703",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "15551576865",
"phone_number_id": "468853166319123"
},
"contacts": [
{
"profile": {
"name": "."
},
"wa_id": "5214428968441"
}
],
"messages": [
{
"from": "5214428968441",
"id": "wamid.HBgNNTIxNDQyODk2ODQ0MRUCABIYFDNBQzU1MTI5MkJBNkVGRjBDN0U5AA==",
"timestamp": "1734487099",
"text": {
"body": "Thanks"
},
"type": "text"
}
]
},
"field": "messages"
}
]
}
]
}To set up any webhook, follow these steps:
You need to create an endpoint on a secure server capable of processing HTTPS requests.
Your endpoint must handle two types of HTTPS requests:
- Verification Requests
- Event Notifications
- The server must have a valid TLS/SSL certificate correctly configured and installed.
- Self-signed certificates are not supported.
When configuring the Webhooks product in your App Dashboard, Meta will send a GET request to your endpoint URL.
Example Verification Request:
GET https://www.your-clever-domain-name.com/webhooks?
hub.mode=subscribe&
hub.challenge=1158201444&
hub.verify_token=meatyhamhockWhenever your endpoint receives a verification request, it must:
- Verify that the
hub.verify_tokenvalue matches the token string you set in the Verify Token field during Webhook configuration in the App Dashboard. - Respond with the
hub.challengevalue sent in the request.
Follow the detailed steps in the DOCS to configure your Webhook in Facebook.
When you configure the Webhooks product, you will subscribe to specific fields on an object type (e.g., the photos field on a user object).
When any subscribed field changes, Meta will send a POST request to your endpoint with a JSON payload describing the change.
Your endpoint must respond to all Event Notifications with a 200 OK HTTPS response.
- Meta does not store any Webhook event notification data.
- Ensure you capture and store any payload content that you want to keep.
For the complete documentation, visit:
Meta Webhooks Getting Started
