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>",
"fields": [
{
"label": "<string>",
"value": "<string>"
}
],
"item_type": "<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>",
"fields": [
{
"label": "<string>",
"value": "<string>"
}
],
"item_type": "<string>",
"page_number": 2
}
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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
channel.message user, agent Text content for a message.
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Reactions grouped by emoji, ordered by first reaction time.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Array of citations that provide sources for factual statements in the response. Each citation includes the referenced text and its sources.
Show child attributes
Show child attributes