Replies and reactions
Integration summary
- Endpoint:
POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging- Token: messaging token, in the
Authorization: Bearer {{wa-msg-api-token}}header (how to generate it)- Common fields:
from,to(phone number or BSUID) andtype(details)typevalues on this page:"text","reaction"- Response: the same for every message (see response)
Messages tied to a previous message: replying to it or reacting to it with an emoji. All are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.
Reply to a message
Replies to a message the customer sent, with its ID in context. The context field can be used with text and media messages (text, image, video, audio, document, sticker). It is ignored for location, contacts and interactive.
Body
Fields for Reply to a message, in addition to the common fields:
| Name | Description | Type | Requirements |
|---|---|---|---|
| context | Object with information about a related message. | Object | Required. |
Context object
| Name | Description | Type | Requirements |
|---|---|---|---|
| message_id | ID of the message you're replying to. Both the WhatsApp wamid and the id returned by POST /v1/messaging are accepted. If the ID is not found or is empty, the context is silently dropped. | String | Required. |
Example
Complete Reply to a message example (HTTP request and JSON body):
HTTP request
curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \-H 'Authorization: Bearer {{wa-msg-api-token}}' \-H 'Content-Type: application/json' \-d '{"from": "5215500000001","to": "5215500000002","type": "text","text": "Hi, good morning! How can I help you?","context":{"message_id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBRjYyNjE2MUFGQkMxMTkxOTI0AA=="}}'
Body
{"from": "5215500000001","to": "5215500000002","type": "text","text": "Hi, good morning! How can I help you?","context":{"message_id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBRjYyNjE2MUFGQkMxMTkxOTI0AA=="}}
Reaction
Reacts to a message with an emoji. The type field must be "reaction".
Body
Fields for Reaction, in addition to the common fields:
| Name | Description | Type | Requirements |
|---|---|---|---|
| reaction | Object with information about a related message. | Object | Required. |
Reaction object
| Name | Description | Type | Requirements |
|---|---|---|---|
| message_id | ID of the message you're reacting to. Both the WhatsApp wamid and the id returned by POST /v1/messaging are accepted. If the ID is not found, the reaction returns MISSING_PARAMS. | String | Required. |
| emoji | Emoji to send. | String | Required. |
Example
Complete Reaction example (HTTP request and JSON body):
HTTP request
curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \-H 'Authorization: Bearer {{wa-msg-api-token}}' \-H 'Content-Type: application/json' \-d '{"from": "5215500000001","to": "5215500000002","type": "reaction","reaction":{"message_id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBRjYyNjE2MUFGQkMxMTkxOTI0AA==","emoji": "๐๐ป"}}'
Body
{"from": "5215500000001","to": "5215500000002","type": "reaction","reaction":{"message_id": "wamid.HBgNNTIxNTUyMDc3NzA1OBUCABIYFDNBRjYyNjE2MUFGQkMxMTkxOTI0AA==","emoji": "๐๐ป"}}
