POST Chat
React To A Message ("Like")
After this completes, a new event appears in the stream representing the reaction.
After this completes, a new event appears in the stream representing the reaction. The new event will have an updated version of the event in the replyto field, which you can use to update your UI.
POST PARAMETERS
- userid: (required) The ID of the user who is reacting.
- reaction: (required) A string for the reaction such as "like", or "emoji:{emojid}" which accepts a standard unicode value for an emoji.
- reacted: (required) true to add reaction or false to remove the reaction.
Request
Parameters
Values in the path and query string.
appid path string TalkLabs ID required
The TalkLabs application ID assigned to your account.
Example:your-app-id roomid path string TalkLabs ID required
The TalkLabs assigned room ID returned when the room was created.
Example:room-id eventid path string TalkLabs ID required
The TalkLabs assigned chat event ID.
Request
JSON body
Send as application/json.
reaction string required
userId string customer-defined required
The customer defined user ID from your application or identity system.
reacted boolean required
Request example
{
"reaction": "like",
"reacted": "true",
"userId": "u-8842"
} Response
Status codes
Every JSON response uses the API result envelope.
200 OK ApiResult 400 Bad Request ApiResult 403 Forbidden ApiResult 404 Not Found ApiResult 500 Internal Server Error ApiResult Example response · 200
{
"message": "",
"errors": {},
"data": {
"kind": "chat.event",
"id": "5ec4aa615617e40ed4e82ab0",
"roomid": "5ec3c1945617e21bd8c5567b",
"body": "",
"added": "2020-05-20T03:56:17.7773748Z",
"ts": 637255437777773700,
"eventtype": "reaction",
"userid": "userid_abe",
"user": {
"kind": "app.user",
"userid": "userid_abe",
"handle": "HonestAbe",
"handlelowercase": "honestabe",
"displayname": "Abraham Lincoln",
"pictureurl": "https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cg_face%2Cq_auto:good%2Cw_300/MTU5MDUzMTE0Mzk2MTI0OTUy/abraham-lincoln-1809---18652c-sixteenth-president-of-the-united-states-of-america-photo-by-stock-montagestock-montagegetty-images_promo.jpg",
"profileurl": "https://www.biography.com/us-president/abraham-lincoln",
"banned": false
},
"customtype": "",
"customid": "",
"custompayload": "",
"customtags": [],
"customfield1": "",
"customfield2": "",
"replyto": {
"kind": "chat.event",
"id": "5ec4aa385617e40ed4e82aaf",
"roomid": "5ec3c1945617e21bd8c5567b",
"body": "Hello a second time!",
"added": "2020-05-20T03:55:36.9845354Z",
"ts": 637255437369845400,
"eventtype": "speech",
"userid": "userid_abe",
"user": {
"kind": "app.user",
"userid": "userid_abe",
"handle": "HonestAbe",
"handlelowercase": "honestabe",
"displayname": "Abraham Lincoln",
"pictureurl": "https://www.biography.com/.image/ar_1:1%2Cc_fill%2Ccs_srgb%2Cg_face%2Cq_auto:good%2Cw_300/MTU5MDUzMTE0Mzk2MTI0OTUy/abraham-lincoln-1809---18652c-sixteenth-president-of-the-united-states-of-america-photo-by-stock-montagestock-montagegetty-images_promo.jpg",
"profileurl": "https://www.biography.com/us-president/abraham-lincoln",
"banned": false
},
"customtype": "",
"customid": null,
"custompayload": "",
"customtags": [],
"customfield1": "",
"customfield2": "",
"replyto": null,
"parentid": "",
"hierarchy": [],
"edited": false,
"deleted": false,
"active": true,
"mutedby": [],
"shadowban": false,
"hashtags": [],
"likecount": 0,
"replycount": 0,
"reactions": [
{
"type": "like",
"count": 1,
"users": [
{
"userid": "userid_abe",
"handle": "HonestAbe",
"displayname": "Abraham Lincoln"
}
]
}
],
"moderation": "na",
"reports": []
},
"parentid": "",
"hierarchy": [],
"edited": false,
"deleted": false,
"active": true,
"mutedby": [],
"shadowban": false,
"hashtags": [],
"likecount": 0,
"replycount": 0,
"reactions": [],
"moderation": "na",
"reports": []
}
}