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

Close Ticket API

POST /closeTicket

Description

This API endpoint allows a user or admin to close an existing support ticket by providing the ticket's unique identifier. Closing a ticket changes its status to indicate that the issue has been resolved or the inquiry has been addressed.

Request Body

The request utilizes GraphQL to perform the closeTicket mutation.

Mutation:

mutation closeTicket ($id: Int!) {
closeTicket (id: $id) {
id
subject
text
category
status
createdAt
}
}

Variables:

{
"id": 0
}
  • id (Int): The unique identifier of the ticket to be closed.

Response:

  • Success (200 OK):

    • If the ticket closure is successful, the response will return the details of the closed ticket, including its ID, subject, category, status (indicating that it is closed), and creation timestamp.
    {
    "data": {
    "closeTicket": {
    "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 ticket ID, missing required fields, or server errors.

Note:

Ensure that the id corresponds to an existing ticket within the platform. Closing a ticket should only be done when the issue has been resolved or the inquiry has been addressed. This API should be used by users or admins with the necessary permissions to manage and close support tickets.