WhatsApp APIAPI

WhatsApp: react to messages

React with an emoji to a message in a WhatsApp conversation, or remove the reaction, through the XBASE API using the message id at Meta.

Updated on

A reaction is an emoji applied to a message in the conversation, like on the phone's WhatsApp. It works on messages received from the contact and on messages sent by the business.

React to a message

POST https://api.xbase.app/api/external/v1/whatsapp/messages/{messageId}/reaction

messageId is the message id at Meta (wamid.…): the one that comes back in the send responses and arrives in the workspace webhooks events.

FieldTypeRequiredRule
emojitextyesA single emoji, like "👍" or "❤️". Empty ("") removes the reaction
curl -X POST https://api.xbase.app/api/external/v1/whatsapp/messages/wamid.HBgNNTUyMTk5OTk5MDAwMBUCABIYFDNBMjc1QjE3RjdCNEE1QzlEMjA4AA==/reaction \
  -H "Authorization: Bearer $XBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "emoji": "👍" }'

Response 200:

{ "success": true }

How the reaction shows up

  • The contact sees the emoji on the message, on their WhatsApp. The reaction also shows up on the message in the Chatcenter.
  • The business has one reaction per message: reacting again swaps the emoji.
  • XBASE does not check the 24-hour window for reactions: Meta decides. If Meta refuses, the response is 422 META_ERROR.
  • Meta does not accept a reaction to a message older than 30 days (422 META_ERROR).

Errors

StatuscodeWhen
400(no code)emoji with more than one emoji or with text, or messageId in the wrong format
404MESSAGE_NOT_FOUNDThe message is not from a WhatsApp conversation in this workspace
422SEND_REJECTEDXBASE refused, for example, because the conversation number was disconnected
422META_ERRORMeta refused, for example, a message older than 30 days

See the full format in Errors.

Frequently asked questions

See also

On this page