> 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/url-response/comment.md).

# Comment

## 댓글 추가

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

This endpoint allows you to get free cakes.

#### Headers

| Name          | Type   | Description                                                           |
| ------------- | ------ | --------------------------------------------------------------------- |
| Authorization | string | Token \<token key> 있으면 username이 nickname이 됨. nickname있으면 nickname이 우 |

#### Request Body

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| item     | number | 댓글 추가하고자 하는 item pk |
| content  | string | 댓글 내용               |
| nickname | string | 없으면 "익명 사용자"가 현     |

{% tabs %}
{% tab title="200  댓글을 추가한  item에 달린 전체 댓글을 보여줌" %}

```
[
    {
        "item": 3,
        "content": "즐겨 먹는 반찬",
        "nickname": "lee"
    },
    {
        "item": 3,
        "content": "즐겨 먹는 반찬",
        "nickname": "lee"
    },
    {
        "item": 3,
        "content": "즐겨 먹는 반찬",
        "nickname": "익명 사용자"
    },
    {
        "item": 3,
        "content": "로그인 한 상태",
        "nickname": "lee"
    },
    {
        "item": 3,
        "content": "시험",
        "nickname": "익명 사용자"
    },
    {
        "item": 3,
        "content": "시험",
        "nickname": "익명 사용자"
    }
]
```

{% endtab %}

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

```javascript
{
    "item": [
        "이 필드는 필수 항목입니다."
    ],
    "content": [
        "이 필드는 필수 항목입니다."
    ]
}
```

{% endtab %}
{% endtabs %}

## 댓글 list 보기

<mark style="color:blue;">`GET`</mark> `https://api.elegantsiblings.xyz/new/comment/item/<item_pk>/`

#### Path Parameters

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| item\_pk | number | 댓글이 달린 반찬(item)의 pk |

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

```
[
    {
        "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": "익명 사용자"
    },
    {
        "item": 1,
        "content": "맛나요",
        "nickname": "익명 사용자"
    },
    {
        "item": 1,
        "content": "맛나요",
        "nickname": "익명 사용자"
    },
   
]
```

{% endtab %}
{% endtabs %}
