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

Create Ticket API

POST /createTicket

Description

This API endpoint allows a user to create a new support ticket by providing details such as the subject, description text, and category. The ticket can then be tracked and managed through the platform's support system.

Request Body

The request utilizes GraphQL to perform the createTicket mutation.

Mutation:

mutation createTicket ($ticket: TicketCreate) {
createTicket (ticket: $ticket) {
id
subject
text
category
status
createdAt
}
}

Variables:

{
"ticket": {
"subject": "<Ticket_Subject>",
"text": "<Ticket_Description>",
"category": "<Ticket_Category>"
}
}
  • ticket (TicketCreate Object): An object containing the details of the ticket to be created.
    • subject (String): The subject or title of the ticket.
    • text (String): The detailed description or text of the ticket.
    • category (String): The category to which the ticket belongs (e.g., technical support, billing, etc.).

Response:

  • Success (200 OK):

    • If the ticket creation is successful, the response will return the details of the newly created ticket, including its ID, subject, category, status, and creation timestamp.
    {
    "data": {
    "createTicket": {
    "id": "<Ticket_ID>",
    "subject": "<Ticket_Subject>",
    "text": "<Ticket_Description>",
    "category": "<Ticket_Category>",
    "status": "<Ticket_Status>",
    "createdAt": "<Creation_Timestamp>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that all required fields for the ticket object are provided and correctly formatted according to the platform's specifications. This API should be used by users or admins to create and manage support tickets within the platform.