Uwierzytelnianie | wymagane |
Format odpowiedzi | json |
Metoda HTTP | GET |
https://your-system-name.thulium.com/api/tickets/:id
id
wymagany |
Identyfikator zgłoszenia.
Przykładowa wartość: 1234
|
include_custom_fields
opcjonalny |
Czy zwracać pola specjalne zgłoszenia.
Przykładowa wartość: true
|
W celu rozróżnienia typu wiadomości w zgłoszeniu, pole type jest ustawione na jedną z wartości:
|
GET | https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true |
{ "ticket_id": 1234, "from": "john.doe@foo.bar", "ticket_queue_name": "test@thulium.pl", "ticket_queue_id": 32, "subject": "Example ticket subject", "status_id": "2", "substatus_id": "2", "customer_id": 32122, "full_status_name": "some status - some sub status", "category_id": "3", "user_login": "akowalski", "created_at": "2014-07-08 08:05", "updated_at": "2014-07-11 08:05", "closed_at": "2014-09-04 17:33", "close_time": "123:33:44", "first_agent_responded_at": "2014-07-04 15:15", "first_agent_response_time": "01:00:12", "messages": [ { "message_id": 432, "user_login": "akowalski", "type": "COMMENT", "body": "", "comment": "Example comment", "system_comment": "", "created_at": "2014-07-08 08:05", "attachments": [] }, { "message_id": 433, "user_login": "akowalski", "type": "COMMENT", "body": "", "comment": "", "system_comment": "Changed status from [Oczekuje na klienta] to [Nowe]", "created_at": "2014-07-02 13:56", "attachments": [] }, { "message_id": 434, "user_login": "akowalski", "type": "COMMENT", "body": "", "comment": "Example comment", "system_comment": "", "created_at": "2014-07-02 13:54", "attachments": [] }, { "message_id": 435, "user_login": "akowalski", "type": "REPLY", "body": "Reply message send to client", "comment": "", "system_comment": "Changed status from [Nowe] to [Oczekuje na klienta]", "created_at": "2014-07-02 13:44", "attachments": ["1175982115cb861c810534", "85734759348c94a5983b12] }, { "message_id": 436, "user_login": "", "type": "MAIL", "body": "Email content", "comment": "", "system_comment": "", "created_at": "2014-07-02 12:28", "attachments": [] } ], "custom_fields": { "ID": null, "Uwagi": "information" } }
<?php
$request = curl_init('https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true');
curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($request, CURLOPT_USERPWD, "api_user:api_pass");
curl_setopt($request, CURLOPT_TIMEOUT, 30);
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($request);
if ($response) {
$httpCode = curl_getinfo($request, CURLINFO_HTTP_CODE);
if ($httpCode == 200){
print_r(json_decode($response));
} else {
echo $response;
}
} else {
trigger_error(curl_error($request), E_USER_WARNING);
}
curl_close($request);
public class Example {
public static void main(String[] args) throws Exception {
ThuliumRestClient restClient = new ThuliumRestClient("api_user", "api_pass", true);
ThuliumRestClient.ThuliumRestResponse response = restClient.get("https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true");
System.out.println(response);
}
}
curl -u api_user:api_pass -k -X GET -H "Accept: application/json" "https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true"
http -a api_user:api_pass GET https://your-system-name.thulium.com/api/tickets/1234 include_custom_fields==true Accept:application/json