# Comments

## Create a comment on a wallpaper

<mark style="color:green;">`POST`</mark> `https://api.lolwallpapers.net/beta/wallpapers/:id/comments`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| id   | string | The wallpaper ID. |

#### Request Body

| Name    | Type   | Description                                       |
| ------- | ------ | ------------------------------------------------- |
| content | string | The content of the comment. (6 caracters minimum) |

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

```
```

{% endtab %}
{% endtabs %}

## Get a wallpaper comments

<mark style="color:blue;">`GET`</mark> `https://api.lolwallpapers.net/beta/wallpapers/:id/comments`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| id   | string | The wallpaper ID. |

#### Query Parameters

| Name  | Type   | Description                                                                                    |
| ----- | ------ | ---------------------------------------------------------------------------------------------- |
| sort  | string | <p>Sort by:<br>- created\_at (default)<br>- updated\_at</p>                                    |
| order | string | <p>Order by:<br>- asc<br>- desc (default)</p>                                                  |
| limit | string | <p>The amount of comments to display per page.<br>Default: 20<br>Minimum: 1<br>Maximum: 50</p> |
| page  | string | <p>The page to display.<br>Default: 1<br>Minimum: 1</p>                                        |

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

```
```

{% endtab %}
{% endtabs %}

## Edit a wallpaper's comment

<mark style="color:purple;">`PATCH`</mark> `https://api.lolwallpapers.net/beta/wallpapers/:wid/comments:cid`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| wid  | string | The wallpaper ID. |
| cid  | string | The comment ID.   |

#### Request Body

| Name    | Type   | Description                 |
| ------- | ------ | --------------------------- |
| content | string | The content of the comment. |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The user must be the author of the comment to be able to edit it.
{% endhint %}

## Delete a wallpaper's comment

<mark style="color:red;">`DELETE`</mark> `https://api.lolwallpapers.net/beta/wallpalers/:wid/comments/:cid`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| wid  | string | The wallpaper ID. |
| cid  | string | The comment ID.   |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The user must be the author of the comment to be able to delete it.
{% endhint %}

## Like a wallpaper's comment

<mark style="color:green;">`POST`</mark> `https://api.lolwallpapers.net/beta/wallpapers/:wid/comments/:cid/like`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| wid  | string | The wallpaper ID. |
| cid  | string | The comment ID.   |

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

```
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If the user has already liked the comment, his "like" will be removed.
{% endhint %}
