import requests
url = "https://api.datagrid.com/v1/channels"
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', 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 \
--header 'Authorization: Bearer <token>'{
"object": "list",
"data": [
{
"object": "channel",
"id": "<string>",
"type": "channel",
"name": "<string>",
"description": "<string>",
"teamspace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true
}List channels
Lists shared public named channels in the resolved teamspace. Private channels, direct messages, and personal chats are intentionally omitted. q filters channel names and does not search message content.
import requests
url = "https://api.datagrid.com/v1/channels"
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', 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 \
--header 'Authorization: Bearer <token>'{
"object": "list",
"data": [
{
"object": "channel",
"id": "<string>",
"type": "channel",
"name": "<string>",
"description": "<string>",
"teamspace_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"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.
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.
Filter by channel type. Only shared named channels are available in v1.
channel Case-insensitive channel-name substring.
200