logo
enes

Replies and reactions

Last update: 6 hours ago by Irais Aguirre

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) and type (details)
  • type values 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:

NameDescriptionTypeRequirements
contextObject with information about a related message.ObjectRequired.

Context object

NameDescriptionTypeRequirements
message_idID 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.StringRequired.

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:

NameDescriptionTypeRequirements
reactionObject with information about a related message.ObjectRequired.

Reaction object

NameDescriptionTypeRequirements
message_idID 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.StringRequired.
emojiEmoji to send.StringRequired.

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": "๐Ÿ‘๐Ÿป"
}
}


Previous
Contacts
Next
Call permission request