پرش به مطلب اصلی

Reply to Ticket API

POST /replyToTicket

Description

This API endpoint allows a user or admin to reply to an existing support ticket by providing the ticket's unique identifier and the reply text. The reply is added to the ticket's conversation thread.

Request Body

The request utilizes GraphQL to perform the replyToTicket mutation.

Mutation:

mutation replyToTicket ($ticketId: Int!, $reply: TicketReplyCreate) {
replyToTicket (ticketId: $ticketId, reply: $reply) {
id
text
createdAt
}
}

Variables:

{
"ticketId": 0,
"reply": {
"text": "<Reply_Text>"
}
}
  • ticketId (Int): The unique identifier of the ticket to which the reply is being added.
  • reply (TicketReplyCreate Object): An object containing the reply details.
    • text (String): The text of the reply.

Response:

  • Success (200 OK):

    • If the reply is successfully added, the response will return the details of the new reply, including its ID, text, and creation timestamp.
    {
    "data": {
    "replyToTicket": {
    "id": "<Reply_ID>",
    "text": "<Reply_Text>",
    "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 ticketId corresponds to an existing ticket within the platform and that the reply object contains valid and correctly formatted data. This API should be used by users or admins with the necessary permissions to manage and respond to support tickets.