Chat message
Chat message refer to conversations between agents and customers in the application or tickets.
Resource representation
The following table shows the list of properties in a chat messages resource.
Property name | Type | Description |
---|---|---|
id | int | The unique ID of a message. |
messageId | int | The unique ID of a chat message in a ticket. |
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 except messages sent from users. |
createdAt | string | The time and date when the message was sent, in ISO 8601 format. |
deletedAt | string | The time and date when the message was deleted, in ISO 8601 format. |
requestedFrom | string | The method through which a message deletion was requested. Valid values are DASHBOARD and PLATFORM_API. |
requestedBy | nested object | The information about the user who made a message deletion request. |
message | string | The content of the message. |
data | string | Additional information about the message such as custom font size, font type, or JSON formatted string. |
Actions
- API endpoints in this page are relative to the base URL allocated to your application as below:
List of endpoints
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}
.
List of actions
Action | HTTP request |
---|---|
| |
| |
| |
|
Retrieve a list of chat messages within a ticket
Retrieves a list of chat messages within a specific ticket.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Parameters
Required | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a 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) |
Response
If successful, this action returns a list of chat message resources in the response body.
List of response properties
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. |
Delete a chat message
Deletes a chat message in a ticket.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Required
Property name | Type | Description |
---|---|---|
ticket_id | int | Specifies the unique ID of a ticket. |
chatmessage_id | int | Specifies the unique ID of a chat message to delete. |
Response
If successful, this action returns the ID of the deleted message in the response body.
Error
In the case of an error, an error object like below is returned. See the error code table for more details.
Error code | Error message | Description |
---|---|---|
deskp400105 | The ticket_id parameter is required. | One or more required parameters are missing. |
deskp400111 | The value of id should be integer. | The specified ID is in incorrect format. |
deskp400201 | The specified message doesn’t exist. | The message with the specified |
deskp400500 | The message was already deleted. | The message with the specified |
deskp400600 | The ticket is not closed yet. | A chat message can't be deleted as the ticket isn't closed yet. |
deskp400601 | The specified message can’t be deleted. | Message deletion isn't supported for the chat message with the specified |
desk500500 | An internal error has occurred. | An error occurred while processing the request. |
List message deletion logs
Retrieve a list of logs for deleted chat messages.
HTTP request
Request body
The following table lists the properties of an HTTP request that this action supports.
Property
Required | Type | Description |
---|---|---|
limit | int | Specifies the number of results to return per page. Acceptable values are 1 to 100, 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) |
Optional | Type | Description |
---|---|---|
start_date | string | Specifies the start date of the logs to retrieve, in YYYY-MM-DD format. The time range between |
end_date | string | Specifies the end date of the logs to retrieve, in YYYY-MM-DD format. The time range between |
Response
If successful, this action returns a list of log resources for deleted messages in the response body.
Error
In the case of an error, an error object like below is returned. See the error code table for more details.
Error code | Error message | Description |
---|---|---|
deskp400111 | The value of limit should be integer. | The value of either |
deskp400111 | The value of start_date should be YYYY-MM-DD. | The value of either |
deskp400113 | The value of limit should be between 1 to 100. | The value specified in |
deskp400113 | The date range should be within 1 year. | The time range between |