List Conversations
Fetch a list of conversations.
Required Resources
To use this service, you'll need:
- Authentication: You'll need a Bearer authentication token.
Endpoint
Get Conversations List
To get the list of conversations, you can use the following endpoint.
Query Param | Type | Description |
---|---|---|
limit (optional) | int | Max number of conversations to retrieve (max 100, default 25). |
statusId (optional, repeatable) | int | Return only conversations that match the provided status code. Uses the following values: 1: OPEN 2: CLOSED 3: PENDING |
page_token (required) | string | Used for pagination. Leave blank for the initial request. |
Request
curl -X GET -H 'Authorization: Bearer <auth_token>' 'https://api.drift.com/conversations/list?limit=50'
import requests
url = "https://api.drift.com/conversations/list?limit=50"
headers = {
"Authorization": "Bearer <auth_token>"
}
response = requests.get(url, headers=headers)
print(response.json())
Replace <auth_token>
with your authentication token.
Response
{
"data": [
{
"status": "open",
"contactId": 17035536800,
"createdAt": 1686303243241,
"id": 3782727146,
"inboxId": 62491,
"updatedAt": 1686303381300
},
...
],
"links": {
"self": "https://api.drift.com/conversations/list?page_token=<self_page_token>",
"next": "https://api.drift.com/conversations/list?page_token=<next_page_token>"
}
}
In the response, each item in the data
array represents a conversation. Each conversation includes fields such as status
, contactId
, createdAt
, id
, inboxId
, and updatedAt
.
The links
object contains links to the current ("self") and next pages of data.
Use the returned "next" link to retrieve the next page of conversations. The limit set in the intial call will be retained.
Example next request
curl -X GET -H 'Authorization: Bearer <auth_token>' 'https://api.drift.com/conversations/list?page_token=<next_page_token>'
import requests
url = "https://api.drift.com/conversations/list?page_token=<next_page_token>"
headers = {
"Authorization": "Bearer <auth_token>"
}
response = requests.get(url, headers=headers)
print(response.json())
Updated 5 days ago