> For the complete documentation index, see [llms.txt](https://baeminchan-project.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://baeminchan-project.gitbook.io/project/undefined-5.md).

# 댓글 달기

item: 댓글 달린 item의 pk임&#x20;

## &#x20;Post Comment

<mark style="color:green;">`POST`</mark> `https://api.elegantsiblings.xyz/comment/`

This endpoint allows you to get free cakes.

#### Headers

| Name          | Type   | Description                                                                              |
| ------------- | ------ | ---------------------------------------------------------------------------------------- |
| Authorization | string | Token \<token key> --> nickname이 없는 경우 username으로  nickname이 적힘. nickname이 있으면 nickname으 |

#### Request Body

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| item\_pk | number | 댓글이 달린 item(반찬)의 pk |
| content  | string | 댓글 내                |
| nickname | string | 없으면 "익명 사용자" 가      |

{% tabs %}
{% tab title="201  item의 전체 댓글이 반환됨" %}

```javascript
[
    {
        "item": 1,
        "content": "매워요!!!!",
        "nickname": "lee"
    },
    {
        "item": 1,
        "content": "test",
        "nickname": "lee"
    },
    {
        "item": 1,
        "content": "test",
        "nickname": "lee"
    },
    {
        "item": 1,
        "content": "맛나요",
        "nickname": "lee"
    },
    {
        "item": 1,
        "content": "맛나요",
        "nickname": "익명 사용자"
    }
]
```

{% endtab %}

{% tab title="400 Could not find a cake matching this query." %}

```javascript
1. content가 없을 때
 {
    "content": [
        "이 필드는 필수 항목입니다."
    ]
}
2. item_pk가 없을 때
{
    "error": "올바르지 않은 Item 입니다"
}
```

{% endtab %}
{% endtabs %}
