# Recipe 101

## server test

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/`

This endpoint allows you to get free cakes.

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

```
"server running"
```

{% endtab %}

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

```
"warning"
```

{% endtab %}
{% endtabs %}

## signout

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/signout`

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

```
{
    message:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## get recipe info

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/recipe/:id`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| :id  | integer | food\_id    |

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

```
{
    data: {
        food_info: {
            id,
            userName,
            foodName,
            summary,
            nation,
            type,
            cookingTime,
            calorie,
            qnt,
            level,
            imgUrl,
            createdAt,
            updatedAt,
        },
        Ingredients: [
            {
                name,
                type,
                cap
            },
            ...
        ],
        Recipes: [
            {
                cookingNo,
                cookingDc,
                stepImage,
                stepTip
            },
            ...
        ],
        Comment:[
            {
                
            },
            ...
        ]
    },
    message: "ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## get userinfo

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/user`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{
    data: {
        userinfo: { userName, email, phone, userImage, createdAt },
     },
      meassge: "ok",
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## get subscribed users

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/subscribe/:username`

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| :username | string | username    |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{
    users:[
        "name1",
        "name2", 
        ...
        ]
    meassge:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## get stored  recipes

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/store`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{ 
    data:[
        {
            id,
            foodName,
            imgUrl,
            level,
            cookingTime,
            score
        },
        {
            id,
            foodName,
            imgUrl,
            level,
            cookingTime,
            score
        },
        ....
    ],  
    message: "0k" 
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## get comment by username

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/comment/user/:username`

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| :username | string | username    |

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

```
{
    data:[
            {
                    id,
                    foodName,
                    text,
                    score,
                    createdAt,
                    updatedAt
            },
            {
                    id,
                    foodName,
                    text,
                    score, 
                    createdAt,
                    updatedAt

            },
            ...
            
    ],
    meassge:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## &#x20;get comments by food\_id

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/comment/food/:id`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| :id  | integer | food\_id    |

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

```
{
    data:[
            {
                    id,
                    username,
                    text,
                    score,
                    createdAt,
                    updatedAt
            },
            {
                    id,
                    username,
                    text,
                    score,
                    createdAt,
                    updatedAt
            },
            ...
            
    ],
    meassge:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## search recipe using user name

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/search/username/:username`

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| :username | string | username    |

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

```
{
    data: {
        recipes: [
            {
                food_id,
                food_name,
                food_img,
                level,
                cooking_time,
                score
            },
            ...
        ],
    }
    message: "ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## search recipe using food name

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/search/foodname/:foodname`

#### Path Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| :foodname | string | food\_name  |

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

```
{
    data: {
        recipes: [
            {
                food_id,
                food_name,
                food_img,
                level,
                cooking_time,
                score
            },
            ...
        ],
    }
    message: "ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## search recipe using item name

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/search/itemname/:itemname&itemname1`

#### Path Parameters

| Name        | Type   | Description           |
| ----------- | ------ | --------------------- |
| :itemname   | string | item\_name            |
| \&itemname1 | string | additional item\_name |

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

```
{
    data: {
        recipes: [
            {
                food_id,
                food_name,
                food_img,
                level,
                cooking_time,
                score
            },
            ...
        ],
    }
    message: "ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## social signin (kakao)

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/kakao`

#### Request Body

| Name | Type   | Description         |
| ---- | ------ | ------------------- |
| code | string | authorization\_code |

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

```
{
    accessToken:"accessToken",
    userinfo: { username, email, phone, userimage },
     },
    message:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## get image

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/image/:name`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| name | string | image name  |

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

```
image
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## recently recipe

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/recent/:num`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| num  | number | number of recipes |

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

```
{
    data: {
        recipes: [
            {
                food_id,
                food_name,
                food_img,
                level,
                cooking_time,
                score
            },
            ...
        ],
    }
    message: "ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## recommend recipe

<mark style="color:blue;">`GET`</mark> `https://server.recipe101.net/recommend/:num`

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| num  | number | number of recipes |

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

```
{
    data: {
        recipes: [
            {
                food_id,
                food_name,
                food_img,
                level,
                cooking_time,
                count,
                score
            },
            ...
        ],
    }
    message: "ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## signin

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/signin`

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| username | string | username    |
| password | string | password    |

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

```
{
    accessToken:"accessToken",
    message:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## signup

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/signup`

#### Request Body

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| userName  | string |             |
| password  | string |             |
| email     | string |             |
| phone     | string |             |
| userImage | string | userimage   |

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

```
{
    accessToken:"accessToken",
    message:"ok"
}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}
{% endtabs %}

## add recipe

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/recipe`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name        | Type   | Description                                                                                             |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------- |
| Food\_info  | object | <p>cook information <br>include: {foodName, summary, nation, type,cookingTime, calorie, qnt, level}</p> |
| Ingredients | array  | <p> Ingredients for cook<br> include: <br>{name, type, cap}</p>                                         |
| Recipe      | array  | <p>how to cook describe step by step <br>include: {cookingNo, cookingDc, stepTip}</p>                   |
| foodImage   | string | foodimage                                                                                               |
| stepImage   | string | stepimages                                                                                              |

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

```
{ message: "ok" }
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## password check

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/password`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| password | string | password    |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## add subscribe

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/subscribe`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| username | string | username    |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## store recipe

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/store`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | food\_id    |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## create comment

<mark style="color:green;">`POST`</mark> `https://server.recipe101.net/comment`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name     | Type    | Description  |
| -------- | ------- | ------------ |
| id       | integer | food\_id     |
| userName | string  | username     |
| comment  | string  | comment text |
| score    | number  | score        |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## update recipe info

<mark style="color:purple;">`PATCH`</mark> `https://server.recipe101.net/recipe/:id`

#### Path Parameters

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| id   | string | update recipe id |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name        | Type   | Description                                                                                                                     |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| Food\_info  | object | <p>cook information <br>include: {food\_name, summary, nation, type,cooking\_time, calorie, qnt, level, (option):food\_img}</p> |
| Ingredients | array  | <p>Ingredients for cook <br>include: {name, type, cap}</p>                                                                      |
| Recipe      | array  | <p>how to cook describe step by step <br>include: <br>{cooking\_no, cooking\_dc (option): step\_image, step\_tip}</p>           |
| foodImage   | string | foodimage                                                                                                                       |
| stepImage   | string | stepimages                                                                                                                      |

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

```
{ message: "ok" }
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## update userinfo

<mark style="color:purple;">`PATCH`</mark> `https://server.recipe101.net/user`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| userName  | string |             |
| email     | string |             |
| phone     | string |             |
| userImage | string | userimage   |

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

```
{ message: "information updated" }
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## password update

<mark style="color:purple;">`PATCH`</mark> `https://server.recipe101.net/password`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name     | Type   | Description  |
| -------- | ------ | ------------ |
| password | string | new password |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## update comment

<mark style="color:purple;">`PATCH`</mark> `https://server.recipe101.net/comment/:id`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | comment id  |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

#### Request Body

| Name    | Type   | Description  |
| ------- | ------ | ------------ |
| comment | string | comment text |
| score   | number | recipe score |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## delete recipe&#x20;

<mark style="color:red;">`DELETE`</mark> `https://server.recipe101.net/recipe/:id`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| :id  | integer | food\_id    |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{ message: "ok" }
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## delete user

<mark style="color:red;">`DELETE`</mark> `https://server.recipe101.net/user`

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{ message: "He (or She)'s gone" }
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## &#x20;Cancel subscription

<mark style="color:red;">`DELETE`</mark> `https://server.recipe101.net/subscribe/:name`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| name | string | userName    |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## remove stored recipe

<mark style="color:red;">`DELETE`</mark> `https://server.recipe101.net/store`

#### Path Parameters

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| food\_id | string | food\_id    |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| authorization | string | access token |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}

## remove comment

<mark style="color:red;">`DELETE`</mark> `https://server.recipe101.net/comment/:id`

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | integer | comment id  |

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| authorization | string | acess token |

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

```
{message:"ok"}
```

{% endtab %}

{% tab title="400 " %}

```
"fail"
```

{% endtab %}

{% tab title="401 " %}

```
"Unauthorized"
```

{% endtab %}
{% endtabs %}
