Chat messages refer to conversations between agents and customers in the application or tickets.
Property name | Type | Description |
---|---|---|
id | int | The unique ID of the message. |
ticket | int | The unique ID of a ticket where the message belongs. |
userSendbirdId | string | The Sendbird ID of a customer or agent who sent the message. A value of event indicates that the message was sent from Desk platform. |
userType | string | The sender of the message. Valid values are AGENT, CUSTOMER, and EVENT. EVENT signifies all messages expcept messages sent from users. |
createdAt | datetime | The time and date when the message was sent, in ISO 8601 format. |
message | string | The content of the message. |
- API endpoints in this page are relative to the base URL allocated to your application as below:
Endpoint | Refers to ... |
---|---|
/chat_messages |
|
/tickets |
|
Note: If you want to know your application ID, sign in to your dashboard, go to the Settings > Application > General, and then check the Application ID.
- It's recommended that the parameter values in API URLs be urlencoded, such as
{ticket_id}
.
Action | HTTP request |
---|---|
| |
|
Retrieves a list of all chat messages in the application.
GET https://desk-api-{application_id}.sendbird.com/platform/v1/chat_messages
The following table lists the parameters that this action supports.
Parameters
Optional | Type | Description |
---|---|---|
limit | int | Specifies the number of results to return per page. Acceptable values are 1 to 500, inclusive. (Default: 50) |
int | Specifies the number of results to skip before retrieving the next page in the result set. This is used to adjust the starting index of the next page. (Default: 0) | |
created_at__gte | string | Restricts the search scope to only retrieve chat messages sent after the specified time, in ISO 8601 format. |
created_at__lte | string | Restricts the search scope to only retrieve chat messages with a specified channel type. Acceptable values are SENDBIRD, FACEBOOK_CONVERSATION, and FACEBOOK_FEED. |
ticket__channel_type | string | Searches for chat messages with a specified channel type. Acceptable values are limited to SENDIBIRD, FACEBOOK_CONVERSATION, and FACEBOOK_FEED. |
Query string example
?limit=50&offset=100
If successful, this action returns a list of chat message resources in the response body.
Status: 200 OK
{
"count": 20492,
"previous": "https://desk-api-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.sendbird.com/platform/v1/chat_messages?limit=50&offset=50",
"next": "https://desk-api-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.sendbird.com/platform/v1/chat_messages?limit=50&offset=150",
"results": [
{
"id": 10933,
"ticket": 3351,
"userSendbirdId": "Jeff",
"userType": "AGENT",
"createdAt": "2019-03-12T05:25:41.032000Z",
"message": "You'll get a 50% refund and the credit card request will be canceled in 3~5 business days."
},
... # More chat messages
]
}
Property name | Type | Description |
---|---|---|
count | int | The total count of chat messages in the application. |
previous | string | The URL to retrieve the previous page in the result set. |
next | string | The URL to retrieve the next page in the result set. |
results[] | list | A list of chat messages. |
Retrieves a list of chat messages within a specific ticket.
GET https://desk-api-{application_id}.sendbird.com/platform/v1/tickets/{ticket_id}/chat_messages
The following table lists the parameters that this action supports.
Parameters
Required | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of the target ticket. |
Optional | Type | Description |
---|---|---|
limit | int | Specifies the number of results to return per page. Acceptable values are 1 to 500, inclusive. (Default: 50) |
int | Specifies the number of results to skip before retrieving the next page in the result set. This is used to adjust the starting index of the next page. (Default: 0) |
Query string example
?limit=10&offset=20
If successful, this action returns a list of chat message resources in the response body.
Status: 200 OK
{
"count": 43,
"previous": "https://desk-api-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.sendbird.com/platform/v1/tickets/325/chat_messages?limit=10&offset=10",
"next": "https://desk-api-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.sendbird.com/platform/v1/tickets/325/chat_messages?limit=10&offset=30",
"results": [
{
"id": 38763,
"ticket": 3351,
"userSendbirdId": "event",
"userType": "EVENT",
"createdAt": "2020-05-11T14:25:54.189000Z",
"message": "Welcome to Sendbird!"
},
... # More chat messages
]
}
Property name | Type | Description |
---|---|---|
count | int | The total count of chat messages within the ticket. |
previous | string | The URL to retrieve the previous page in the result set. |
next | string | The URL to retrieve the next page in the result set. |
results[] | list | A list of chat messages. |