> For the complete documentation index, see [llms.txt](https://developer.leaderos.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.leaderos.net/support/tickets.md).

# Tickets

## Get tickets

<mark style="color:blue;">`GET`</mark> `https://yourwebsite.com/api/support/tickets`

{% tabs %}
{% tab title="200: OK " %}

```json
[
    {
        "id": "1",
        "accountID": "1",
        "categoryID": "3",
        "title": "I need help!",
        "statusID": "2",
        "readStatus": "1",
        "updateDate": "2022-09-15 10:54:46",
        "creationDate": "2022-09-15 10:51:02",
        "categoryName": "Other",
        "messages": [
            {
                "id": "3",
                "accountID": "1",
                "message": "please **help** me!",
                "writeLocation": "1",
                "creationDate": "2022-09-15 10:53:46"
            },
            {
                "id": "4",
                "accountID": "3",
                "message": "<p><strong>How can I help you?</strong></p>",
                "writeLocation": "2",
                "creationDate": "2022-09-15 10:54:46"
            }
        ]
    },
    {
        "id": "2",
        "accountID": "1",
        "categoryID": "1",
        "title": "Cheater report!",
        "statusID": "2",
        "readStatus": "1",
        "updateDate": "2022-09-15 10:54:27",
        "creationDate": "2022-09-15 10:52:07",
        "categoryName": "Cheat",
        "messages": [
            {
                "id": "1",
                "accountID": "1",
                "message": "please **help** me!",
                "writeLocation": "1",
                "creationDate": "2022-09-15 10:53:27"
            },
            {
                "id": "2",
                "accountID": "3",
                "message": "<p>thanks banned!</p>",
                "writeLocation": "2",
                "creationDate": "2022-09-15 10:54:27"
            }
        ]
    }
]
```

{% endtab %}
{% endtabs %}

## Get a ticket

<mark style="color:blue;">`GET`</mark> `https://yourwebsite.com/api/support/tickets/<id>`

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "id": "6",
    "accountID": "1",
    "categoryID": "1",
    "title": "Deneme Başlık!2",
    "statusID": "1",
    "readStatus": "0",
    "updateDate": "2023-07-19 20:13:37",
    "creationDate": "2023-07-19 20:13:37",
    "category": {
        "id": "1",
        "name": "Cheat"
    },
    "messages": [
        {
            "id": "6",
            "accountID": "1",
            "message": "Merhaba deneme içerikkk2",
            "writeLocation": "1",
            "creationDate": "2023-07-19 20:13:37"
        }
    ]
}
```

{% endtab %}

{% tab title="404: Not Found Ticket not found" %}

```json
{
    "status": false,
    "error": "TICKET_NOT_FOUND",
    "message": "Ticket not found!"
}
```

{% endtab %}
{% endtabs %}

## Create ticket

<mark style="color:green;">`POST`</mark> `https://yourwebsite.com/api/support/tickets/<id>`

#### Request Body

| Name                                         | Type   | Description                                                                                                                                                      |
| -------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| accountID<mark style="color:red;">\*</mark>  | String |                                                                                                                                                                  |
| categoryID<mark style="color:red;">\*</mark> | String |                                                                                                                                                                  |
| title<mark style="color:red;">\*</mark>      | String |                                                                                                                                                                  |
| message<mark style="color:red;">\*</mark>    | String |                                                                                                                                                                  |
| statusID                                     | String | <p>Default: 1 (Open)</p><p><strong>1:</strong> Open</p><p><strong>2:</strong> Answered</p><p><strong>3:</strong> User-Reply</p><p><strong>4:</strong> Closed</p> |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "success": true,
    "data": {
        "id": "6"
    }
}
```

{% endtab %}
{% endtabs %}

## Close ticket

<mark style="color:green;">`POST`</mark> `https://yourwebsite.com/api/support/tickets/<id>/close`

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "success": true,
    "data": {
        "id": "6"
    }
}
```

{% endtab %}

{% tab title="404: Not Found Ticket not found" %}

```json
{
    "status": false,
    "error": "TICKET_NOT_FOUND",
    "message": "Ticket not found!"
}
```

{% endtab %}
{% endtabs %}
