# Messages

## Get all messages of a ticket

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

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

```json
[
    {
        "id": "1",
        "accountID": "1",
        "supportID": "2",
        "message": "please **help** me!",
        "writeLocation": "1",
        "creationDate": "2022-09-15 10:53:27"
    },
    {
        "id": "2",
        "accountID": "3",
        "supportID": "2",
        "message": "<p>thanks banned!</p>",
        "writeLocation": "2",
        "creationDate": "2022-09-15 10:54:27"
    },
    {
        "id": "7",
        "accountID": "1",
        "supportID": "2",
        "message": "Merhaba deneme içerikkk2",
        "writeLocation": "2",
        "creationDate": "2023-07-19 20:32:34"
    },
    {
        "id": "8",
        "accountID": "1",
        "supportID": "2",
        "message": "Merhaba deneme içerikkk2",
        "writeLocation": "2",
        "creationDate": "2023-07-19 20:32:54"
    },
    {
        "id": "9",
        "accountID": "1",
        "supportID": "2",
        "message": "Merhaba deneme içerikkk2",
        "writeLocation": "2",
        "creationDate": "2023-07-19 20:34:34"
    }
]
```

{% endtab %}
{% endtabs %}

## Get a message of a ticket

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

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

```json
{
    "id": "9",
    "accountID": "1",
    "supportID": "2",
    "message": "Merhaba deneme içerikkk2",
    "writeLocation": "2",
    "creationDate": "2023-07-19 20:34:34"
}
```

{% endtab %}
{% endtabs %}

## Add messages to tickets

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

#### Path Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| ticket-id | integer |             |

#### Request Body

| Name                                      | Type    | Description    |
| ----------------------------------------- | ------- | -------------- |
| message<mark style="color:red;">\*</mark> | String  |                |
| accountID                                 | String  |                |
| isAdmin                                   | boolean | Default: false |
| discordUserID                             | String  |                |

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

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

{% endtab %}
{% endtabs %}
