import requests
url = "https://api.datagrid.com/v1/channels/{channel_id}/messages/{message_id}/reactions"
payload = { "reaction": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reaction: '<string>'})
};
fetch('https://api.datagrid.com/v1/channels/{channel_id}/messages/{message_id}/reactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/channels/{channel_id}/messages/{message_id}/reactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reaction": "<string>"
}
'{
"object": "channel.message",
"id": "<string>",
"channel_id": "<string>",
"thread_id": "<string>",
"role": "user",
"agent_id": "<string>",
"content": [
{
"type": "text",
"text": "<string>"
}
],
"reply_count": 123,
"reactions": [
{
"reaction": "<string>",
"users": [
{
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"credits": {
"consumed": 123
},
"citations": [
{
"citation": "<string>",
"sources": [
{
"type": "image",
"source_name": "<string>",
"confirmations": [
"<string>"
],
"source_id": "<string>",
"source_uri": "<string>",
"external_url": "<string>",
"status": "<string>",
"status_color": "<string>",
"status_category": "open",
"fields": [
{
"label": "<string>",
"value": "<string>"
}
],
"item_type": "<string>",
"thumbnail_url": "<string>",
"page_number": 2
}
]
}
]
}Add a message reaction
Adds the authenticated API user’s reaction to a channel or thread message. The reacting user cannot be overridden: callers can only add their own reaction. Repeating the same reaction is idempotent. The caller must be a channel member. Returns the updated message.
The reaction must be an emoji available in the Datagrid emoji picker, supplied either as a shortcode (:+1:) or as the unicode character (👍). Shortcodes are resolved to the unicode character before storage, so a reaction added through the API groups together with the same emoji added in the app. Anything else is rejected with a 400.
import requests
url = "https://api.datagrid.com/v1/channels/{channel_id}/messages/{message_id}/reactions"
payload = { "reaction": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reaction: '<string>'})
};
fetch('https://api.datagrid.com/v1/channels/{channel_id}/messages/{message_id}/reactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.datagrid.com/v1/channels/{channel_id}/messages/{message_id}/reactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reaction": "<string>"
}
'{
"object": "channel.message",
"id": "<string>",
"channel_id": "<string>",
"thread_id": "<string>",
"role": "user",
"agent_id": "<string>",
"content": [
{
"type": "text",
"text": "<string>"
}
],
"reply_count": 123,
"reactions": [
{
"reaction": "<string>",
"users": [
{
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"credits": {
"consumed": 123
},
"citations": [
{
"citation": "<string>",
"sources": [
{
"type": "image",
"source_name": "<string>",
"confirmations": [
"<string>"
],
"source_id": "<string>",
"source_uri": "<string>",
"external_url": "<string>",
"status": "<string>",
"status_color": "<string>",
"status_category": "open",
"fields": [
{
"label": "<string>",
"value": "<string>"
}
],
"item_type": "<string>",
"thumbnail_url": "<string>",
"page_number": 2
}
]
}
]
}Authorizations
Body
Emoji shortcode (for example :+1: or :heart:) or unicode emoji (👍). Must be an emoji offered by the Datagrid emoji picker; shortcodes are stored as their unicode character so API and in-app reactions group together. Always attributed to the authenticated API user; there is no field to react as another user.
1 - 64Response
Updated message