Single ticket
POST https://secure.usedesk.com/uapi/ticket
The method returns ticket information by its id. It gets one argument: ticket id.
* — required fields
Parameter | Value |
api_token* | Channel API token |
ticket_id* | Ticket ID |
accessible_for_agent_id |
Filtering by Agent ID Considers the rights of the employee. The server returns the variable rights:
|
properties |
Time until SLA "properties": ["sla"]
If SLAs are not specified in the ticket, SLAs are not returned in the response |
Request example
$data = array( 'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4', 'accessible_for_agent_id'=>'6339', 'ticket_id'=>'2261648', ); $mch_api = curl_init(); curl_setopt($mch_api, CURLOPT_URL, 'https://secure.usedesk.com/uapi/ticket'); curl_setopt($mch_api, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0'); curl_setopt($mch_api, CURLOPT_RETURNTRANSFER, true); curl_setopt($mch_api, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($mch_api, CURLOPT_TIMEOUT, 10); curl_setopt($mch_api, CURLOPT_POST, true); curl_setopt($mch_api, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($mch_api, CURLOPT_POSTFIELDS, $data); $result = curl_exec($mch_api); return $result;
The server returns a ticket, all comments, tags and a history of changes.
Example of a response from server
{ "ticket":{ "id":"2265179", "status_id":"1", "subject":"additional fields", "client_id":"261702", "assignee_id":"2", "group":"0", "last_updated_at":"2017-03-01 14:30:49", "email":"0", "published_at":"2017-03-01 14:30:49", "company_id":"153561" }, "comments":[ { "id":"2658287", "message":"additional fields", "from":"client", "user_id":null, "client_id":"261702", "ticket_id":"2265179", "is_first":"0", "delivered":"0", "readed":"0", "published_at":"2017-03-01 14:30:49" } ], "changes":[ { "id":"213671", "trigger_id":"1260", "user_id":null, "ticket_id":"2265179", "data":[ { "target":"assignee", "value":"2" } ], "changed_at":"2017-03-01 14:30:49", "old_status":"0", "new_status":"0", "company_id":"153561" }, { "id":"213669", "trigger_id":null, "user_id":null, "ticket_id":"2265179", "data":[ ], "changed_at":"2017-03-01 14:30:49", "old_status":"0", "new_status":"1", "company_id":"153561" } ], "tags":[ "Bycicle Number":"134", "Veggies":"tomato" ], "custom_fields":[ { "id":"143", "ticket_id":"2265179", "ticket_field_id":"10", "value":"134" }, { "id":"145", "ticket_id":"2265179", "ticket_field_id":"7", "value":"1" }, { "id":"147", "ticket_id":"2265179", "ticket_field_id":"9", "value":"9" } ] "rights": "write", }
Server response parameters
Parameter | Description | ||||||||||||||||||||||||||||||||||
id |
Ticket ID | ||||||||||||||||||||||||||||||||||
status_id | ID of ticket status | ||||||||||||||||||||||||||||||||||
priority | Ticket priority | ||||||||||||||||||||||||||||||||||
type | Ticket type | ||||||||||||||||||||||||||||||||||
subject | Ticket subject | ||||||||||||||||||||||||||||||||||
client_id | Client ID | ||||||||||||||||||||||||||||||||||
assignee_id | Assignee ID | ||||||||||||||||||||||||||||||||||
group | Group ID | ||||||||||||||||||||||||||||||||||
last_updated_at | Date and time of the last ticket update UTC+0 time zone |
||||||||||||||||||||||||||||||||||
Email that the request came from Specified if the request was created in the email channel |
|||||||||||||||||||||||||||||||||||
published_at | Ticket creation date and time UTC+0 time zone |
||||||||||||||||||||||||||||||||||
company_id | Company ID | ||||||||||||||||||||||||||||||||||
channel_id | Channel ID | ||||||||||||||||||||||||||||||||||
additional_id | Additional ID Service field |
||||||||||||||||||||||||||||||||||
client_name | Client name | ||||||||||||||||||||||||||||||||||
active_sla | Array of current ticket SLAs
|
||||||||||||||||||||||||||||||||||
comments | Ticket comments array
|
||||||||||||||||||||||||||||||||||
changes | Array of ticket changes
|
||||||||||||||||||||||||||||||||||
tags | Ticket tags array | ||||||||||||||||||||||||||||||||||
custom_fields | Array with values of additional fields of the ticket
|
||||||||||||||||||||||||||||||||||
rights | The rights of the specified employee
|