curl --request POST \
--url https://{appid}.api-{region}.cometchat.io/v3/messages/{id}/reactions/{reaction} \
--header 'apikey: <api-key>' \
--header 'onBehalfOf: <onbehalfof>'
{
"data": {
"id": "2",
"conversationId": "superhero1_user_superhero2",
"sender": "superhero1",
"receiverType": "user",
"receiver": "superhero2",
"category": "message",
"type": "text",
"data": {
"text": "Hi,",
"entities": {
"sender": {
"entity": {
"uid": "superhero1",
"name": "Iron Man",
"role": "default",
"status": "offline"
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "superhero2",
"name": "Captain America",
"role": "default",
"status": "offline",
"conversationId": "superhero1_user_superhero2"
},
"entityType": "user"
}
},
"reactions": [
{
"reaction": ":reaction",
"count": 1
},
{
"reaction": "😅",
"count": 1
},
{
"reaction": "😒",
"count": 1,
"reactedByMe": true
},
{
"reaction": "🤨",
"count": 1,
"reactedByMe": true
}
]
},
"sentAt": 1700210266,
"updatedAt": 1700210266
}
}
Adds a reaction to a message.
curl --request POST \
--url https://{appid}.api-{region}.cometchat.io/v3/messages/{id}/reactions/{reaction} \
--header 'apikey: <api-key>' \
--header 'onBehalfOf: <onbehalfof>'
{
"data": {
"id": "2",
"conversationId": "superhero1_user_superhero2",
"sender": "superhero1",
"receiverType": "user",
"receiver": "superhero2",
"category": "message",
"type": "text",
"data": {
"text": "Hi,",
"entities": {
"sender": {
"entity": {
"uid": "superhero1",
"name": "Iron Man",
"role": "default",
"status": "offline"
},
"entityType": "user"
},
"receiver": {
"entity": {
"uid": "superhero2",
"name": "Captain America",
"role": "default",
"status": "offline",
"conversationId": "superhero1_user_superhero2"
},
"entityType": "user"
}
},
"reactions": [
{
"reaction": ":reaction",
"count": 1
},
{
"reaction": "😅",
"count": 1
},
{
"reaction": "😒",
"count": 1,
"reactedByMe": true
},
{
"reaction": "🤨",
"count": 1,
"reactedByMe": true
}
]
},
"sentAt": 1700210266,
"updatedAt": 1700210266
}
}
API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
UID of the user on whose behalf the action is performed.
Id of the message to react.
reaction to react.
Adding reaction
The response is of type object
.