Add or remove a reaction to a message
Add or remove emoji reactions to messages. Reactions let users express their response to a message without sending a new message.
Supported Reactions:
- love ❤️
- like 👍
- dislike 👎
- laugh 😂
- emphasize ‼️
- question ❓
- custom - any emoji as a tapback (use
custom_emojifield to specify) - sticker - an emoji or image peeled onto the message (use
emoji,urlorattachment_id)
custom and sticker are different products. A custom reaction is a
tapback: the emoji sits in a small bubble on the corner of the message. A
sticker is peeled onto the bubble itself, and can be dragged, resized and
rotated. Both accept an emoji; they do not look alike.
Stickers are iMessage-only and cannot be removed, so
operation: "remove" with type: "sticker" is rejected. Position, size
and rotation are optional via placement, and can be changed afterwards
with PATCH /v3/messages/{messageId}/reactions/{reactionId}. An animated
image peels as an animated sticker, in whatever shape the file already has.
Add or remove a reaction to a message
import LinqAPIV3 from '@linqapp/sdk';
const client = new LinqAPIV3({
apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});
const response = await client.messages.addReaction('69a37c7d-af4f-4b5e-af42-e28e98ce873a', {
operation: 'add',
type: 'love',
});
console.log(response.trace_id);{
"message": "Reaction processed",
"status": "accepted",
"trace_id": "trace_id"
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/1xxx/1002/"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/2xxx/2004/"
},
"success": false
}{
"error": {
"status": 403,
"code": 2005,
"message": "Access denied - insufficient permissions for this resource",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/2xxx/2005/"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/3xxx/3006/"
},
"success": false
}Returns Examples
{
"message": "Reaction processed",
"status": "accepted",
"trace_id": "trace_id"
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/1xxx/1002/"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/2xxx/2004/"
},
"success": false
}{
"error": {
"status": 403,
"code": 2005,
"message": "Access denied - insufficient permissions for this resource",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/2xxx/2005/"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error",
"doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/3xxx/3006/"
},
"success": false
}