# user

## 회원가입

<mark style="color:green;">`POST`</mark> `https://meplody.com/user-signup`

회원가입

#### Headers

| Name                                              | Type    | Description      |
| ------------------------------------------------- | ------- | ---------------- |
| withCredentials<mark style="color:red;">\*</mark> | boolean |                  |
| Content-Type<mark style="color:red;">\*</mark>    | string  | application/json |

#### Request Body

| Name                                       | Type   | Description      |
| ------------------------------------------ | ------ | ---------------- |
| nickname<mark style="color:red;">\*</mark> | string | nickname of user |
| email<mark style="color:red;">\*</mark>    | string | email of user    |
| password<mark style="color:red;">\*</mark> | string | password of user |
| image                                      | string | image of user    |
| userId<mark style="color:red;">\*</mark>   | string | userId of user   |

{% tabs %}
{% tab title="201: Created 회원가입이 완료되었습니다" %}

```javascript
{
 "message": "회원가입이 완료되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 중복된 아이디입니다" %}

```javascript
{
 "message": "중복된 아이디입니다"
}
```

{% endtab %}
{% endtabs %}

## 로그인

<mark style="color:green;">`POST`</mark> `https://meplody.com/user-login`

로그인

#### Headers

| Name                                              | Type    | Description           |
| ------------------------------------------------- | ------- | --------------------- |
| withCredentials<mark style="color:red;">\*</mark> | boolean |                       |
| Conteny-Type<mark style="color:red;">\*</mark>    | string  | application/json      |
| authorization<mark style="color:red;">\*</mark>   | string  | Bearer ${accessToken} |

#### Request Body

| Name                                       | Type   | Description  |
| ------------------------------------------ | ------ | ------------ |
| userId<mark style="color:red;">\*</mark>   | string | 아이디 of user  |
| password<mark style="color:red;">\*</mark> | string | 비밀번호 of user |

{% tabs %}
{% tab title="200 로그인 되었습니다" %}

```javascript
{
 "message": "로그인 되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 아이디, 패스워드를 확인해주세요" %}

```javascript
{
 "message": "아이디, 패스워드를 확인해주세요"
}
```

{% endtab %}
{% endtabs %}

## 로그아웃

<mark style="color:blue;">`GET`</mark> `https://meplody.com/user-logout`

로그아웃

#### Headers

| Name                                            | Type   | Description           |
| ----------------------------------------------- | ------ | --------------------- |
| authorization<mark style="color:red;">\*</mark> | string | Bearer ${accessToken} |

#### Cookies

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| refreshToken<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 로그아웃 되었습니다" %}

```javascript
{
 "message": "로그아웃 되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 잘못된 요청입니다" %}

```javascript
{
 "message": "잘못된 요청입니다"
}
```

{% endtab %}

{% tab title="401: Unauthorized 로그인이 필요합니다" %}

```javascript
{
 "message": "로그인이 필요합니다"
}
```

{% endtab %}
{% endtabs %}

## 회원탈퇴

<mark style="color:red;">`DELETE`</mark> `https://meplody.com/user-withdrawal`

회원탈퇴

#### Headers

| Name                                            | Type   | Description           |
| ----------------------------------------------- | ------ | --------------------- |
| authorization<mark style="color:red;">\*</mark> | string | Bearer ${accessToken} |

#### Cookies

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| refreshToken<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="204: No Content 회원탈퇴가 완료되었습니다" %}

```javascript
{
 "message": "회원탈퇴가 완료되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 잘못된 요청입니다" %}

```javascript
{
 "message": "잘못된 요청입니다"
}
```

{% endtab %}

{% tab title="401: Unauthorized 로그인이 필요합니다" %}

```javascript
{
 "message": "로그인이 필요합니다"
}
```

{% endtab %}
{% endtabs %}

## 회원정보 조회

<mark style="color:blue;">`GET`</mark> `https://meplody.com/userinfo`

회원정보 조회

#### Headers

| Name                                            | Type   | Description           |
| ----------------------------------------------- | ------ | --------------------- |
| authorization<mark style="color:red;">\*</mark> | string | Bearer ${accessToken} |

#### Cookies

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| refreshToken<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 정보가 수정되었습니다" %}

```javascript
{
 "message": "정보가 수정되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 잘못된 요청입니다" %}

```javascript
{
 "message": "잘못된 요청입니다"
}
```

{% endtab %}

{% tab title="401: Unauthorized 로그인이 필요합니다" %}

```javascript
{
 "message": "로그인이 필요합니다"
}
```

{% endtab %}
{% endtabs %}

## 회원정보 수정

<mark style="color:orange;">`PUT`</mark> `https://meplody.com/userinfo`

회원정보 수정

#### Headers

| Name                                            | Type   | Description           |
| ----------------------------------------------- | ------ | --------------------- |
| authorization<mark style="color:red;">\*</mark> | string | Bearer ${accessToken} |

#### Cookies

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| refreshToken<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 정보가 수정되었습니다" %}

```javascript
{
 "message": "정보가 수정되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 잘못된 요청입니다" %}

```javascript
{
 "message": "잘못된 요청입니다"
}
```

{% endtab %}

{% tab title="401: Unauthorized 로그인이 필요합니다" %}

```javascript
{
 "message": "로그인이 필요합니다"
}
```

{% endtab %}
{% endtabs %}

## 토큰 인증

<mark style="color:blue;">`GET`</mark> `https://meplody.com/tokenAuth`

토큰 인증

#### Headers

| Name                                            | Type   | Description           |
| ----------------------------------------------- | ------ | --------------------- |
| authorization<mark style="color:red;">\*</mark> | string | Bearer ${accessToken} |

#### Cookies

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| refreshToken<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 정보가 수정되었습니다" %}

```javascript
{
 "message": "정보가 수정되었습니다"
}
```

{% endtab %}

{% tab title="400: Bad Request 잘못된 요청입니다" %}

```javascript
{
 "message": "잘못된 요청입니다"
}
```

{% endtab %}

{% tab title="401: Unauthorized 로그인이 필요합니다" %}

```javascript
{
 "message": "로그인이 필요합니다"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** This API method was created sing the API Method block, it's how you can build out an API method documentation from scratch. Have a play with the block and you'll see you can do some nifty things like add and reorder parameters, document responses, and give your methods detailed descriptions.
{% endhint %}

{% hint style="info" %}
**Good to know:** This API method was auto-generated from an example Swagger file. You'll see that it's not editable – that's because the contents are synced to an URL! Any time the linked file changes, the documentation will change too.
{% endhint %}
