Informacje

Uwierzytelnianie wymagane
Format odpowiedzi json
Metoda HTTP GET

GET tickets/:id

Ostatnia modyfikacja 2024-11-20 13:20:36
Zwraca informacje o zgłoszeniu.

URL

https://your-system-name.thulium.com/api/tickets/:id

Parametry

id

wymagany

Identyfikator zgłoszenia. Przykładowa wartość: 1234
include_custom_fields

opcjonalny

Czy zwracać pola specjalne zgłoszenia. Przykładowa wartość: true

Uwagi

W celu rozróżnienia typu wiadomości w zgłoszeniu, pole type jest ustawione na jedną z wartości:
  • MAIL - wiadomość przysłana od klienta
  • REPLY - wiadomość wysłana do klienta
  • COMMENT - komentarz

Przykładowy request

GET https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true

Przykładowy response

{
    "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"
    }
}

Przykładowe wywołanie


PHP

<?php
$request 
curl_init('https://your-system-name.thulium.com/api/tickets/1234?include_custom_fields=true');
curl_setopt($requestCURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));
curl_setopt($requestCURLOPT_USERPWD"api_user:api_pass");
curl_setopt($requestCURLOPT_TIMEOUT30);
curl_setopt($requestCURLOPT_RETURNTRANSFERtrue);

$response curl_exec($request);
if (
$response) {
    
$httpCode curl_getinfo($requestCURLINFO_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);
JAVA

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

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"

HTTPie

http -a api_user:api_pass GET https://your-system-name.thulium.com/api/tickets/1234 include_custom_fields==true Accept:application/json