Create Callback Profile for Outgoing WhatsApp Messages
You must configure the Callback Profile for WhatsApp Outgoing Messages to receive notifications regarding the WhatsApp message status (sent, delivered, read, and failed) for all the messages sent using your registered business WhatsApp number. You need to first create a Callback Profile and then add the Callback Profile ID to the WhatsApp Number.
Creating a Callback Profile for WhatsApp OutgoingMessages
To create a Callback Profile for Outgoing WhatsApp messages:
-
Follow the instructions given in Callback Profiles.
-
Select the required HTTP method:
i. GET and in the Endpoint field, enter the endpoint and the query parameters as shown in the following example:https://webhook.site/7ef1e66d-4231-46f7-907a-75dXXXXXf0dc?id=<id>&custom_response=<custom_response>×tamp=<timestamp>&mobile=<mobile>&message=<message>&status=<status>&phone_number=<phone_number>&error=<error>&error_code=<error_code>&ref=<ref>&ref1=<ref1>&ref2=<ref2>&price=<price>
Note:
- You need to add your own endpoint where you want to receive notifications (the one here is just an example).
- You MUST add all the query parameters in order to get the information about the incoming message.
ii. POST and
a. In the Endpoint field, enter the endpoint (as shown in the following example) where you want to receive notifications as shown:
https://webhook.site/7ef1e66d-4231-46f7-907a-75df0df6357c
b. Enter the following POST Method in the Endpoint field:
{
"id": "<id>",
"custom_response": "<custom_response>",
"timestamp": "<timestamp>",
"mobile": "<mobile>",
"message": "<message>",
"status": "<status>",
"phone_number": "<phone_number>",
"error": "<error>",
"error_code": "<error_code>",
"ref": "<ref>",
"ref1": "<ref1>",
"ref2": "<ref2>",
"price": "<price>"
}
Sample Response
The following is an example of a callback received due to an outgoing text message received by a customer:
status delivered
price 0.01
custom_response false
id ad97eXXX-c923-4XXX-b3a3-0b1XXXXXXd97:0
message Message delivered
phone_number 91XXXXXXXX83
mobile 91XXXXXXXX83
whatsapp_number 91XXXXXXXX80
timestamp 1710000042
The following table displays the parameter used in the sample response:
Note:
All these parameters are supported for both callback_url and callback profile_id.
Parameter | Description |
---|---|
status | Message delivery status. |
price | Price of the conversation opened by the delivered message. Shown only when billed. |
custom_response | The static field is always set to false. |
id | The unique API message ID shared with the customer in the callback. |
message | Message delivery information. |
phone_number | The phone number of the recipient. |
mobile | The mobile number of the recipient. |
whatsapp_number | The registered WhatsApp number is in E164 format. |
timestamp | The time at which the callback is received. |
Note:
- For the postpaid account type, the price value exists in the callbacks for Delivered status whenever that message opens a conversation and hence it is charged.
- For the Tech Provider account type, the price parameter is not supported.
Limitations
- The callback about the delivered messages that opened any of the first 1000 free service conversations will have a price value pair shown in the callbacks even though the price will not be actually charged.
Add the Callback Profile ID to the WhatsApp Number
To receive a callback about the outgoing WhatsApp messages, you must ensure that the WhatsApp number has an associated Callback Profile ID configured. You can do this while creating a new WhatsApp Number or you can edit the configuration for an existing number.
Note:
You can use different callback profiles for other WhatsApp numbers, as in, different endpoints if needed.
- On the profile settings drop-down list, select the Callback Profiles option.
The Callback Profiles page appears with all the existing callback profiles.
- On the Callback Profiles page, hover over the Callback Profile ID that you want to copy and click .
- On the menu, click Channels and on the WhatsApp card, click Manage.
- Click the Configurations tab. On the Numbers page, click Add Number.
Or
On the Numbers page, click the three dots corresponding to the number that you want to edit and click Edit. Only the details of an approved number can be edited.
- In the Callback Profile ID field, enter the callback profile ID that is used in the APIs to trigger the callback to receive an update about the message status (e.g. Delivered, Read). For more information, refer to the instructions on the Add a Number page to configure a new number or Edit the configuration for an existing number.
Updated 19 days ago