Create channel message
import requests
url = "https://api.datagrid.com/v1/channels/{channel_id}/messages"
payload = {
"content": "<string>",
"file_ids": ["<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({content: '<string>', file_ids: ['<string>']})
};
fetch('https://api.datagrid.com/v1/channels/{channel_id}/messages', 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 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"file_ids": [
"<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
}
]
}
]
}Channels
Create channel message
Posts as the authenticated API user, who must be a channel member. Eligible channel agents may respond and consume credits.
POST
/
channels
/
{channel_id}
/
messages
Create channel message
import requests
url = "https://api.datagrid.com/v1/channels/{channel_id}/messages"
payload = {
"content": "<string>",
"file_ids": ["<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({content: '<string>', file_ids: ['<string>']})
};
fetch('https://api.datagrid.com/v1/channels/{channel_id}/messages', 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 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"file_ids": [
"<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.
Path Parameters
Response
201 - application/json
Created message
Available options:
channel.message Available options:
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