Перейти к основному содержимому

Ticket API

POST /ticket

Description

This API endpoint retrieves details of a specific ticket by its ID.

Request Body

The request uses GraphQL to perform the ticket query, which requires the id of the ticket as a parameter.

Query:

query ticket ($id: Int) {
ticket (id: $id) {
id
subject
text
category
status
createdAt
}
}

GraphQL Variables:

{
"id": 0
}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query ticket ($id: Int) {\n ticket (id: $id) {\n id\n subject\n text\n category\n status\n createdAt\n }\n}","variables":{"id":0}}'

Response:

  • Success (200 OK):

    • The response includes details of the ticket with the specified ID.
    {
    "data": {
    "ticket": {
    "id": 123,
    "subject": "Issue with Login",
    "text": "User is unable to log in with their credentials.",
    "category": "Login Issue",
    "status": "Open",
    "createdAt": "2024-08-11T10:00:00Z"
    }
    }
    }
    • id: Unique identifier for the ticket.
    • subject: Subject of the ticket.
    • text: Description or content of the ticket.
    • category: Category or type of the ticket.
    • status: Current status of the ticket (e.g., Open, Closed).
    • createdAt: Timestamp when the ticket was created.
  • Error (4XX/5XX):

    • If the ticket is not found or if there is a server error, the response will include an error message and status code.

Note:

To use this endpoint, you need to provide the id of the ticket you wish to retrieve. The response will provide detailed information about that specific ticket, including its subject, content, category, and status.