Desk Platform API v1
Desk Platform API
Desk Platform API
Version 1

Ticket

Copy link

With the Ticket API, you can manage inquiries from your customers. When a new ticket is submitted, your agents and customers can start a conversation within it.


Resource representation

Copy link

The following table shows the list of properties in a ticket resource.

Property nameTypeDescription

id

int

The unique ID of the ticket.

project

int

The unique ID of a Desk project where the agent belongs. Desk projects have their own corresponding Sendbird application on a one-to-one basis.

channelName

string

The name of the ticket.

channelUrl

string

The channel URL of the ticket from Sendbird Chat platform. The value of tickets from social networks will be generated arbitrarily by Desk.

createdAt

string

The date and time when the ticket was created, in ISO 8601 format.

closedAt

string

The date and time when the ticket was closed, in ISO 8601 format.

issuedAt

string

The date and time when the customer sent the first message, in ISO 8601 format.

durationTime

int

The time in seconds taken from a customer's first message to ticket closing.

pendingTime

int

The time in seconds taken from a customer's first message to ticket assignment.

conversationTime

int

The time in seconds taken from a customer's first message to the last message of the conversation.

customer

nested object

An object that contains the information of the customer.

status2

string

The status of the ticket. This property has been updated from the previous version status to be consistent with the ticket status on the Sendbird Dashboard. Valid values are limited to the following:
- INITIALIZED: tickets whose conversation has been started with welcome messages, but when there is no reply from the corresponding customer.
- PROACTIVE: tickets whose conversation has been started with proactive messages, but when there is no reply from the corresponding customer.
- PENDING: tickets that haven't been assigned to any agent yet.
- ACTIVE: tickets that are assigned to agents and under the interactions.
- CLOSED: closed tickets whose interaction between the agent and customer is ended.
- WORK_IN_PROGRESS: tickets that are yet to be closed for any number of reasons but which can be ACTIVE once the conversation between the agent and customer is started.
- IDLE: tickets whose customer hasn't replied for a set amount of time after the agent's last response.

closeStatus

string

The reason why the ticket has been closed. Valid values are limited to the following:
- NOT_CLOSED: indicates the ticket is not closed yet.
- CLOSED_BY_SYSTEM: indicates the ticket was closed by the API.
- CLOSED_BY_CUSTOMER: indicates the ticket was closed by the customer.
- CLOSED_BY_ADMIN: indicates the ticket was closed by an admin.
- CLOSED_BY_AGENT: indicates the ticket was closed by an agent.
- CLOSED_BUT_NOT_DEFINED (deprecated): indicates the closed ticket but the subject who closed it is unknown.

recentAssignment

nested object

The detailed information about the last assignment.

closeComment

string

The comment left for ticket closing.

closeMessage

string

The message for ticket closing, which is sent instead of the default closing message set in Settings > Triggers of your dashboard.

info

string

The information of a ticket such as subject and the requester given upon its creation.

messageCount

int

The total count of the messages in the ticket.

lastMessage

string

The last message of the ticket.

lastMessageSender

string

The sender of the last message. Valid values are CUSTOMER, AGENT, and PLATFORM.

lastMessageAt

string

The date and time when the last message was sent, in ISO 8601 format.

lastUserMessageSender

string

The sender of the last text message except for the admin messages from Desk Platform. Valid values are CUSTOMER and AGENT.

lastUserMessageAt

string

The date and time when the customer sent the last message, in ISO 8601 format.

updatedAt

string

The date and time when the ticket information was last updated, in ISO 8601 format.

firstAssignmentToCloseTime

int

The time in seconds taken from the first assignment of a ticket to ticket closing.

firstResponseTime

int

The time in seconds taken from a customer’s first message to an agent’s first response.

channelType

string

A channel type that indicates which channel the ticket belongs to. Valid values are SENDBIRD, SENDBIRD_IOS, SENDBIRD_ANDROID, SENDBIRD_JAVASCRIPT, FACEBOOK_CONVERSATION, FACEBOOK_FEED, TWITTER_STATUS, TWITTER_DIRECT_MESSAGE_EVENT, INSTAGRAM_COMMENT, and WHATSAPP_MESSAGE.

data

string

The information related to tickets from social networks.

lastSeenAt

int

The timestamp when the customer first read the last message in the ticket, in Unix millisecond. The value of 0 indicates the customer hasn't read the last message yet. This property is applicable for tickets from Facebook only.

group

nested object

The group which this ticket belongs to.

customFields[]

array

An array of key-value custom fields that indicates additional information about the ticket. This property can have up to 20 custom fields.

customerSatisfactionScore

int

The customer satisfaction score. Valid values are 1 to 5, inclusive.

customerSatisfactionComment

string

The feedback from a customer about the support within the ticket.

priority

string

The priority of the ticket. Valid values are LOW, MEDIUM, HIGH, and URGENT. When it comes to ticket assignment with the auto ticket routing function, a ticket with a higher priority takes precedence over others.

priorityValue

int

The priority value of the ticket. Valid values are 10, 20, 30, and 40, which indicate Low, Medium, High, and Urgent in the priority, respectively. The value can be set in increments of 10, and the higher the priority, the higher the value will be.

relatedChannel

nested object

The information of channels in Sendbird Chat platform that are related to this ticket.


Actions

Copy link
  • API endpoints are relative to the base URL allocated to your application. In this page, the /tickets endpoint refers to https://desk-api-{application_id}.sendbird.com/platform/v1/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

Copy link
ActionHTTP request

List tickets

GET /tickets
Retrieves a list of tickets all tickets in the application.

View a ticket

GET /tickets/{ticket_id}
Retrieves information on a specific ticket.

Create a ticket

POST /tickets
Creates a ticket.

Update a ticket

PATCH /tickets/{ticket_id}
Updates a ticket's priority and URLs of the related channels.

Update custom fields of a ticket

PATCH /tickets/{ticket_id}/custom_fields
Updates custom fields of a specific ticket.

Close a ticket

PATCH /tickets/{ticket_id}/close
Closes a ticket.

Reopen a closed ticket

PATCH /tickets/{ticket_id}/reopen
Reopens a closed ticket.

Transfer a ticket to an agent

POST /tickets/{ticket_id}/transfer
Transfers tickets from an agent to another agent.

Transfer tickets to a group

POST /tickets/transfer_to_group
Transfers tickets with a specific status to a specific team.

Cancel assignment of a ticket

PATCH /tickets/{ticket_id}/cancel
Cancels assignment of a specific ticket from an agent.

Update CSAT data of a closed ticket

PATCH tickets/{ticket_id}/csat
Updates a CSAT score and comment of a closed ticket.


List tickets

Copy link

Retrieves a list of all tickets in the application.

HTTP request

Copy link
GET https://desk-api-{application_id}.sendbird.com/platform/v1/tickets

Parameters

Copy link

The following table lists the parameters that this action supports.

Optional
Parameter nameTypeDescription

limit

int

Specifies the number of results to return per page. Acceptable values are 1 to 500, inclusive. (Default: 50)

offset

int

Specifies the number of results to skip when receiving a response. The value of offset is also used as the starting index of each page. Acceptable values are 0 to 10,000, inclusive. (Default: 0)

status2

string

Restricts the search scope to only retrieve tickets whose status matches the specified value. You can also specify multiple status2 items like status2=IDLE&status2=PENDING. Acceptable values are limited to the following:
- INITIALIZED: tickets whose conversation has been started with welcome messages, but when there is no reply from the corresponding customer.
- PROACTIVE: tickets whose conversation has been started with proactive messages, but when there is no reply from the corresponding customer.
- PENDING: tickets that haven't been assigned to any agent yet.
- ACTIVE: tickets that are assigned to agents and under the interactions.
- CLOSED: closed tickets whose interaction between the agent and customer is ended.
- WORK_IN_PROGRESS: tickets that are yet to be closed for any number of reasons but which can be ACTIVE once the conversation between the agent and customer is started.
- IDLE: tickets whose customer hasn't replied for a set amount of time after the agent's last response.

agent

string

Specifies the unique ID of an agent to restrict the search scope to only retrieve tickets assigned to a specific agent.

group

string

Restricts the search scope to only retrieve tickets assigned to the specified team.

sendbird_id

string

Restricts the search scope to only retrieve tickets submitted by a customer with a specified Sendbird ID.

q

string

Restricts the search scope to retrieve up to 100 tickets that match a specified keyword. The specified keyword is applied to the following: channel names, and customers' display names and Sendbird IDs. For example, q=cindy retrieves tickets whose channel name, or a customer's display name or Sendbird ID includes cindy.

assignment_status

string

Restricts the search scope to only retrieve tickets whose assignment status matches the specified value. Acceptable values are limited to the following:
- NOT_RESPONDED: tickets whose assignee hasn’t responded yet.
- RESPONDED: tickets whose assignee responded.
- IDLE: tickets whose assignee responded, but when there is no reply from the corresponding customer for a set amount of time. Once the customer replies, its assignment status will be changed to NOT_RESPONDED.

channel_url

string

Restricts the search scope to only retrieve tickets related to a specified channel URL.

updated_since

date

Specifies a starting date that restricts the search scope to retrieve tickets that have been updated after the point, in YYYY-MM-DD format.

start_date

date

Specifies a starting date that restricts the search scope to retrieve tickets created between start_date and end_date, in YYYY-MM-DD format.

end_date

date

Specifies an ending date that restricts the search scope to retrieve tickets created between start_date and end_date, in YYYY-MM-DD format.

order

string

Specifies the method to sort a list of results. Acceptable values are limited to the following:
- id (default): sorts by ticket ID in ascending order.
- -id: sorts by ticket ID in descending order.
- created_at: sorts by the time of ticket creation in ascending order.
- -created_at: sorts by the time of ticket creation in descending order.

?limit=20&offset=40

Response

Copy link

If successful, this action returns a list of ticket resources in the response body.

{
    "count": 523,
    "previous": "https://desk-api-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.sendbird.com/platform/v1/tickets?limit=20&offset=20",
    "next": "https://desk-api-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx.sendbird.com/platform/v1/tickets?limit=20&offset=60",
    "results":[
        {
            "id": 3351,
            "project": 13,
            "channelName": "Issue #818",
            "createdAt": "2020-03-21T06:52:51.374823Z",
            "channelUrl": "sendbird_group_channel_730883_973004c40cc0c881e603b61ba5dab3ce17a2a",
            "closedAt": "2020-03-21T07:16:14.995451Z",
            "issuedAt": "2020-03-21T06:52:55.701744Z",
            "durationTime": 36898079,
            "pendingTime": 0,
            "conversationTime": 36838815,
            "customer": {
                "id": 680,
                "sendbirdId": "hi_duskan",
                "channelType": "SENDBIRD",
                "project": 13,
                "createdAt": "2020-03-12T05:25:35.055635Z",
                "memo": null,
                "displayName": "Duskan",
                "photoThumbnailUrl": "https://sendbird.com/main/img/profiles/profile_duskan.png",
                "customFields": []
            },
            "closeStatus": "CLOSED_BY_ADMIN",
            "recentAssignment": {
                "id": 8177,
                "assignedTicket": 3351,
                "agent": {
                    "id": 28,
                    "displayName": "Angel_Mike",
                    "project": 13,
                    "user": 13,
                    "sendbirdId": "sendbird_desk_agent_id_319bf388-3e97-4245-870e-2653f2e9ecb0",
                    "role": "AGENT",
                    "createdAt": "2020-03-12T05:30:35.504014Z",
                    "status": "ACTIVE",
                    "connection": "ONLINE",
                    "email": "mike.angel@sendbird.com",
                    "photoThumbnailUrl": "https://file.sendbird.com/profile_images/mike_vacation.png",
                    "connectionUpdatedAt": "2020-08-13T04:31:28.653651Z",
                    "tier": "EXPERT"
                },
                "assignedAt": "2020-03-21T06:52:55.993589Z",
                "responsedAt": "2020-03-21T06:53:02.526407Z",   // This property will be deprecated soon. Use `respondedAt` instead.
                "respondedAt": "2020-03-21T06:53:02.526407Z",
                "endedAt": "2020-03-21T07:16:14.995469Z",
                "status": "IDLE",
                "responseTime": 5
            },
            "closeComment": "This idle ticket has been closed automatically by Sendbird Desk",
            "info": "{\"ticket\":{\"subject\":\"Issue #818\",\"requester\":{\"name\":\"Duskan\",\"email\":\"hi_duskan\"}}}",
            "messageCount": 6,
            "lastMessage": "This ticket is closed by sbdesk.",
            "lastMessageSender": "PLATFORM",
            "lastMessageAt": "2020-03-21T07:16:15.385722Z",
            "lastUserMessageSender": "AGENT",
            "lastUserMessageAt": "2020-03-21T07:14:11.284000Z",
            "lastMessageMembers": "[]",
            "updatedAt": "2020-02-14T02:16:57.646078Z",
            "lastMessagePayload": null,
            "firstAssignmentToCloseTime": 1399,
            "firstResponseTime": 590484,
            "channelType": "SENDBIRD",
            "data": "{}",
            "lastSeenAt": 0,
            "group": {
                "id": 51,
                "name": "Sales",
                "key": null,
                "project": 13,
                "createdAt": "2019-06-20T04:57:58.743091Z",
                "createdBy": 27,
                "description": "Sales related tickets are assigned to this time."
            },
            "customFields": [],
            "customerSatisfactionScore": null,
            "customerSatisfactionComment": null,
            "priority": "URGENT",
            "priorityValue": 40,
            "status2": "CLOSED",
            "relatedChannels": null
        },
        ... # More tickets
    ]
}

List of response properties

Copy link
Property nameTypeDescription

count

int

The total count of tickets registered 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 tickets.

In the case of an error, an error object like below is returned. See the error code table for more details.

JSONbashbashbashbashbashbashbashbashbashbashbashbash
{
    "message": "An internal error has occurred.",
    "code": 500500,
    "error": true
}