When you get a messages webhook indicating a received message, you can use the message.id
value to mark the message as read and display a typing indicator so the WhatsApp user knows you are preparing a response. This is good practice if it will take you a few seconds to respond.
The typing indicator will be dismissed once you respond, or after 25 seconds, whichever comes first. To prevent a poor user experience, only display a typing indicator if you are going to respond.
curl -X POST \ 'https://graph.facebook.com// /messages' -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d ' { "messaging_product": "whatsapp", "status": "read", "message_id": " ", "typing_indicator": { "type": "text" } }'
Placeholder | Description | Example value |
---|---|---|
String | Required. |
|
String | Optional. Graph API version. | v23.0 |
String | Required. WhatsApp business phone number ID. |
|
String | Required. WhatsApp message ID. This ID is assigned to the |
|
Upon success:
{ "success": true }
curl 'https://graph.facebook.com/v23.0
/106540352242922/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"messaging_product": "whatsapp",
"status": "read",
"message_id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgARGBJDQjZCMzlEQUE4OTJBMTE4RTUA",
"typing_indicator": {
"type": "text"
}
}'
Upon success:
{ "success": true }