React to a Message
Use the POST /message/reaction endpoint to react to a message with an emoji — or to remove an existing reaction.
The reaction request
| Field | Required | Description |
|---|---|---|
message_id | yes | The Zoko message id (UUID) of the message to react to. |
emoji | — | The emoji to react with. Send an empty string (or omit) to remove the reaction. |
customer_id | yes | The customer whose message you're reacting to (used to locate the message). |
agent_id | yes | The agent who is reacting. |
channel | — | Optional, defaults to whatsapp. |
note
message_id here is the Zoko message id — not the platform wamid.
Use Zoko's own message id (the messageId returned by Send Message, or from message history). This is the opposite of the reply_to.reply_to_id field, which uses the WhatsApp wamid.
Add a reaction
curl --request POST \
--url https://chat.zoko.io/v2/message/reaction \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'apikey: <apikey>' \
--data '{
"message_id": "068a169a-f1fe-11ea-9b75-42010a67e00f",
"emoji": "❤️",
"customer_id": "<customer-uuid>",
"agent_id": "<agent-uuid>"
}'
import requests
url = "https://chat.zoko.io/v2/message/reaction"
payload = {
"message_id": "068a169a-f1fe-11ea-9b75-42010a67e00f",
"emoji": "❤️",
"customer_id": "<customer-uuid>",
"agent_id": "<agent-uuid>"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"apikey": "<apikey>"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
Remove a reaction
Send the same request with an empty emoji to remove your reaction from the message.
Response
{
"status": "202",
"message": "Reaction added successfully",
"messageId": "068a169a-f1fe-11ea-9b75-42010a67e00f",
"action": "add"
}
tip
action tells you what happened: add (new reaction), update (changed the emoji), remove (reaction removed), or none (no change).