Use this API to send a reaction message to a WhatsApp user.
Reaction messages are emoji-reactions that you can apply to a previous WhatsApp user message that you have received.
Request Parameters
Key | Description | Values | Data Types | Required/Optional | Constraints |
---|---|---|---|---|---|
Authorization | Access Token for the application | {{PARTNER_APP_TOKEN}} | String | Required | Should be a valid Partner App Access Token. |
appId | App ID to fetch the access token | {{APP_ID}} | String | Required | The Id should be a valid app Id of Gupshup |
messaging_product | Messaging product | String | Required | ||
recipient_type | Recipient type | individual | String | Required | |
to | Destination phone no where the message need to be send | 91785876xxxx | String | Required | Must be a valid phone number. |
type | Messaging type | reaction | String | Required | Type should be reaction to send reaction message. |
reaction | • Unicode escape sequence of the emoji, or the emoji itself, to apply to the user message. • WhatsApp message ID of message you want to apply the emoji to. If the message you are reacting to is more than 30 days old, doesn't correspond to any message in the conversation, has been deleted, or is itself a reaction message, the reaction message will not be delivered and you will receive a messages webhook with error code 131009. | "reaction": | Object | Required | Key should be reaction to send reaction message. |
Sample Request
curl --location --request POST 'https://qa-partner-api.gupshup.io/partner/app/bf9ee64c-3d4d-4ac4-8668-732e577007c4/v3/message' \
--header 'Authorization: sk_e45eb372979f48dead602b52483259be' \
--header 'Content-Type: application/json' \
--data-raw '{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{WHATSAPP_USER_PHONE_NUMBER}}",
"type": "reaction",
"reaction": {
"message_id": "{{WHATSAPP_MESSAGE_ID}}",
"emoji": "{{EMOJI}}"
}
}'
Sample Response
{
"messages": [
{
"id": "GUPSHUP_MESSAGE_ID"
}
],
"messaging_product": "whatsapp",
"contacts": [
{
"input": "DESTINATION_PHONE_NO",
"wa_id": "DESTINATION_PHONE_NO"
}
]
}
Status Codes
Status Code | Response | Comments |
---|---|---|
Success | ||
200 | { "messages": [ { "id": "GUPSHUP_MESSAGE_ID" } ], "messaging_product": "whatsapp", "contacts": [ { "input": "DESTINATION_PHONE_NO", "wa_id": "DESTINATION_PHONE_NO" } ] }` | |
Error | ||
401 | { "status": "error", "message": "Authentication Failed" }` | When API key authentication fails |
400 | { "message": "Callback Billing must be enabled for this API", "status": "error" }` | If Callback billing is not enabled for the app |
400 | { "message": "Invalid App Details", "status": "error" }` | If app details are not found |