WABA Integration (Cloud)
Getting started
The WhatsApp Cloud API allows you to implement WhatsApp Business APIs through Meta's hosting services.
For any outgoing actions (like messages sending), you need to use requests with appropriate endpoints. Please refer to Meta's Official Documentation above for Cloud API.
All Cloud API actions are available via different request types that use a combination of a root base URL and an endpoint suffix. To ensure that you use the correct endpoints for your API calls, we recommend to set-up
https://waba-v2.360dialog.io/
as a base URL and, for each request suffix, you can refer to our documentation or reach out to our Support Team for clarification.The body of the request to the API will determine what exactly you want to send (text, image, etc.).
You need to use an API key received from the client in authorization purposes.
A business cannot send a freely composed message first. If business starts a conversation with a user, it should use a template message. Please do not forget about Opt-In requirements.
Tip: we can recommend to use Postman as first step instrument to test WABA opportunities.
To receive any information that is not a response to your request to the API (e.g. incoming messages from users) you need to set a webhook address.
It should be unique for every WABA number
It should return an HTTPS 200 OK response immediately (before any other processing begins)
Base URL
The default base URL for the Cloud API is https://waba-v2.360dialog.io
followed by the path-specific endpoint.
Prerequisites & Basic Setup
1. Retrieve API Key
In order to send requests with the 360dialog Cloud API, you will need an API KEY.
2. Set Webhook URL
To receive notifications for in- and outbound messages, you have to set a webhook URL, that we use as a destination for all notifications belonging to your WhatsApp phone number.
Webhook URLs for Cloud API do not support "_
"(underscore)
or ":xxxx
"(port)
in (sub)domain names.
Invalid webhook URL: https://your_webhook.example.com
Valid webhook URL: https://yourwebhook.example.com
Invalid webhook URL:https://subdomain.your_webhook.example.com
:3000
Valid webhook URL: https://subdomain.yourwebhook.example.com
Send & Receive Messages
3. Send a message
Once you get the wa_id
, you can start sending messages.
Use the messages node/messages
to send text messages, media, documents, and message templates to your customers.
You can send messages by making a POST
call to the /messages
node regardless of message type. The content of the JSON message body differs for each type of message (text, image, etc.).
4. Receive a message
In case you have set a webhook URL as described in step 2. Set Webhook URL, you will have received a Outbound Message Status Notification for your test message by now.
Webhooks can be used for:
Inbound Message Notifications: Use it to get a notification you when you have received a message.
Message Status Notifications: Monitor the status of sent messages.
If a webhook event isn't delivered for any reason (e.g., the client is offline) or if the webhook request returns a HTTP status code other than 200, we retry the webhook delivery. We continue retrying delivery with increasing delays up to a certain timeout (typically 24 hours, though this may vary), or until the delivery succeeds.
Webhook Requirements
To deploy a live webhook that can receive webhook events from the WhatsApp Business API, your code must have the following:
HTTPS support
A valid SSL certificate
Set your callback URL
Send a POST
request to the /v1/configs/webhook
endpoint to set the resource.
POST /v1/configs/webhook
{
"url": "{{your-callback-url}}"
}
Callback URL Header Authentication (Optional)
If the callback URL needs to be authorized by user, USER
and PASS
should be provided in the header Authorization
that contains Basic base64(USER:PASS)
.
Request body example for USER=testuser
and PASS=testpass
{
"url": "{{your-callback-url}}",
"headers": {
"Authorization": "Basic {{token}}"
}
}
Blacklisted Endpoints
For security reasons you will not be able to access any of the below endpoints. If you need to access any of the below resources, please create a support ticket and, depending on the nature of the request, we will provide some options for you.
Settings (
v1/settings/*)
except profile info which is allowedCertificates (
/v1/certificates/*
)Registration (
/v1/account
)Stats and metrics (
/v1/stats/*
|/metrics
)Support (
/v1/support
)Users (
/v1/users/*
Country Restrictions
In addition to the mentioned country restrictions, businesses operating with Cloud API in Turkey can utilize the WhatsApp Platform for their communication needs. However, due to limitations, users within Turkey are unable to receive messages sent through the API. See Meta's documentation for more information.
Last updated
Was this helpful?