List conversations
Changed onThis endpoint lets you list all the Conversations you have access to.
You can filter the conversations based on the Organization or the Business that they are related to.
If you want to keep an up-to-date list of ongoing conversations for your businesses, we recommend using the Message Received and Message Deleted Webhooks instead of periodically calling this endpoint.
⚠️ This endpoint is paginated using cursor pagination. This means that in order to get the next page of results, you need to provide the cursor returned in the previous call.
Request
- Base URLhttps://api.partoo.co/v2
- AuthAPI key in header x-APIKey
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Number of items to return per page.
The cursor identifiying the page of data to fetch. If no cursor is provided, the query will return the first page of data. A cursor for the next page of data is provided in the response of this request.
Filter by business ids. Use a comma-separated list to provide multiple ids.
[ "5409c35a97bbc544d8e26737" ]
Filter by the date of the last message of the conversation.
Return all the conversations whose last message date >= given_date.
For example: last_message_date__gte=2023-01-01T00:00:00Z will return all conversations whose last message was sent or received from the first of January 2023 onwards.
Note: the date must include an explicit UTC offset (e.g. the Z suffix, or +00:00). A date with no timezone information is rejected with a 400 error.
Combining this with last_message_date__lte defines a range: last_message_date__gte must not be later than last_message_date__lte, or the request is rejected with a 400 error.
Filter by the date of the last message of the conversation.
Return all the conversations whose last message date <= given_date.
For example: last_message_date__lte=2023-01-31T23:59:59Z will return all conversations whose last message was sent or received up until the 31st of January 2023.
Note: the date must include an explicit UTC offset (e.g. the Z suffix, or +00:00). A date with no timezone information is rejected with a 400 error.
Combining this with last_message_date__gte defines a range: last_message_date__gte must not be later than last_message_date__lte, or the request is rejected with a 400 error.
Response
OK
Example response
{
"conversations": [
{
"consumer_img": "https://www.example.com/profile-picture.jpg",
"consumer_name": "John Doe",
"consumer_phone_number": "+33612345678",
"consumer_email": "john.doe@example.com",
"last_message": {
"date": "2023-01-31 16:22:17.327878+00:00",
"sender_label": "Jane Doe"
},
"created_at": "2023-01-31 16:22:17.327878+00:00",
"messaging_partner": "Facebook",
"issues": [
"facebook_no_page_linked"
],
"last_message_date": "2023-01-31 16:22:17.327878+00:00",
"assigned_user_id": "62d80fae74e8b11d700302b8"
}
],
"count": 1
}Changes
- info
added the new optional
queryrequest parameterlast_message_date__gte - info
added the new optional
queryrequest parameterlast_message_date__lte - info
added the non-success response with the status
- info
added the optional property
//to the response with the status
- info