List thread messages
import requests
url = "https://api.datagrid.com/v1/channels/{channel_id}/threads/{thread_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datagrid.com/v1/channels/{channel_id}/threads/{thread_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.datagrid.com/v1/channels/{channel_id}/threads/{thread_id}/messages \
--header 'Authorization: Bearer <token>'{
"object": "list",
"data": [
{
"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
}
]
}
]
}
],
"has_more": true
}Channels
List thread messages
GET
/
channels
/
{channel_id}
/
threads
/
{thread_id}
/
messages
List thread messages
import requests
url = "https://api.datagrid.com/v1/channels/{channel_id}/threads/{thread_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datagrid.com/v1/channels/{channel_id}/threads/{thread_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.datagrid.com/v1/channels/{channel_id}/threads/{thread_id}/messages \
--header 'Authorization: Bearer <token>'{
"object": "list",
"data": [
{
"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
}
]
}
]
}
],
"has_more": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
The limit on the number of objects to return, ranging between 1 and 100.
Required range:
1 <= x <= 100A cursor to use in pagination. after is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo to fetch the next page of the list.
A cursor to use in pagination. before is an object ID that defines your place in the list. For example, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include before=obj_bar to fetch the previous page of the list.