Skip to main content

User Tickets API

POST /userTickets

Description

This API endpoint retrieves a list of tickets associated with the currently authenticated user.

Request Body

The request uses GraphQL to perform the userTickets query, which retrieves all tickets for the user.

Query:

query userTickets {
userTickets {
id
subject
text
category
status
createdAt
}
}

GraphQL Variables:

{}

Example Request:

curl --location '' \
--header 'Content-Type: application/json' \
--data '{"query":"query userTickets {\n userTickets {\n id\n subject\n text\n category\n status\n createdAt\n }\n}","variables":{}}'

Response:

  • Success (200 OK):

    • The response includes a list of tickets with details about each ticket.
    {
    "data": {
    "userTickets": [
    {
    "id": 1,
    "subject": "Issue with login",
    "text": "Unable to login with my credentials.",
    "category": "Technical",
    "status": "Open",
    "createdAt": "2024-08-11T14:32:00Z"
    },
    {
    "id": 2,
    "subject": "Payment issue",
    "text": "The payment did not go through.",
    "category": "Billing",
    "status": "Closed",
    "createdAt": "2024-08-10T09:20:00Z"
    }
    ]
    }
    }
    • id: Unique identifier for the ticket.
    • subject: Brief description of the ticket.
    • text: Detailed description of the issue or request.
    • category: Category of the ticket (e.g., Technical, Billing).
    • status: Current status of the ticket (e.g., Open, Closed).
    • createdAt: Timestamp when the ticket was created.
  • Error (4XX/5XX):

    • If there is an issue with the request or if there is a server error, the response will include an error message and status code.

Note:

This endpoint is used to fetch tickets created by the currently authenticated user. The response provides comprehensive details of each ticket, including its ID, subject, description, category, status, and creation timestamp.