> 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/like.md).

# Like (찜하기)

## &#x20;찜한 목록 보기

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

This endpoint allows you to get free cakes.

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Token \<token key> |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
[
    {
        "item": {
            "pk": 1,
            "item_name": "굴생채무침(2~3인분) 220g",
            "company": "집반찬연구소",
            "origin_price": 9800,
            "sale_price": 9800,
            "discount_rate": 0,
            "list_thumbnail": null
        },
        "created_at": "2018-12-14T16:08:23.502317+09:00"
    },
    {
        "item": {
            "pk": 2,
            "item_name": "고깃집 그 참기름 묵은지무침 (1~2인분) 200g",
            "company": "집밥의완성",
            "origin_price": 3300,
            "sale_price": 2450,
            "discount_rate": 0.25,
            "list_thumbnail": "https://wps-9th-chajeehyung-practice.s3.amazonaws.com/media/Item/cat7.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIG4DIK7WJ5QD5WAA%2F20181217%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Date=20181217T112050Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=6bb03b89a91e40ecb666e60f8459b6450cbbda80bc9f0ba6bf3d1c229fa19d63"
        },
        "created_at": "2018-12-14T16:08:23.502317+09:00"
    },
    {
        "item": {
            "pk": 3,
            "item_name": "표고버섯 무나물 (1인분) 150g",
            "company": "탐나는밥상",
            "origin_price": 4500,
            "sale_price": 4050,
            "discount_rate": 0.1,
            "list_thumbnail": null
        },
        "created_at": "2018-12-14T16:08:23.502317+09:00"
    }
]
```

{% endtab %}

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

```javascript
{
    "detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}
or
{
    "detail": "토큰이 유효하지 않습니다."
}
```

{% endtab %}
{% endtabs %}

<mark style="color:green;">`POST`</mark> `https://api.elegantsiblings.xyz/new/members/like-item/`

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Token \<token key> |

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| item | number | 찜할 item의 pk |

{% tabs %}
{% tab title="201 성공적으로 추가" %}

```
```

{% endtab %}

{% tab title="400  이미 있는 item을 찜하려고 할 때 " %}

```
{
    "non_field_errors": [
        "필드 user, item 는 반드시 고유(unique)해야 합니다."
    ]
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}
or
{
    "detail": "토큰이 유효하지 않습니다."
}
```

{% endtab %}
{% endtabs %}

```
body parameter 예제
{
    "item": 4
}
```

<mark style="color:red;">`DELETE`</mark> `https://api.elegantsiblings.xyz/new/members/like-item/`

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Token \<token key> |

#### Request Body

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| item | number | 찜 해제할 item의 pk |

{% tabs %}
{% tab title="204  삭제 성" %}

```
```

{% endtab %}

{% tab title="401 " %}

```
{
    "detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}
or
{
    "detail": "토큰이 유효하지 않습니다."
}
```

{% endtab %}

{% tab title="404 찜 목록에 없는 item을 삭제하려고 할때" %}

```
{
    "detail": "찾을 수 없습니다."
}
```

{% endtab %}
{% endtabs %}
