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

# user API

## user information 유저 정보 조회            &#x20;

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

&#x20;마이페이지에서 자신의 정보 조회                 &#x20;

#### Headers

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| Authentication | string | AccessToken |

{% tabs %}
{% tab title="200  유저정보 획득" %}

```
"data": {
    "id": 1,
    "nickname": "kimcoding",
    "email": "kimcoding@authstates.com",
    "password": "1234",
    "birthDay": "19950321",
    "createdAt": "2021-09-15T09:54:30.000Z",
    "updatedAt": "2021-09-15T09:54:30.000Z"
    }
}
```

{% endtab %}

{% tab title="404  유저정보 id 불일치 " %}

```
{    "message": "해당 유저를 찾을 수 없습니다."}
```

{% endtab %}
{% endtabs %}

## &#x20;user signup 회원가입        &#x20;

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

&#x20;회원가입            &#x20;

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| nickname | string | 닉네임         |
| email    | string | 이메일         |
| password | string | 비밀번호        |
| birthDay | object | 생년월일        |

{% tabs %}
{% tab title="200  회원가입 완료 " %}

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

{% endtab %}

{% tab title="409 1. 닉네임 중복
2\. 이메일 중복" %}

```
// 1. 닉네임 중
{ 
    message: `${nickname}은 존재하는 닉네임입니다.` 
}

// 2. 이메일 중
{ 
    message: `${email}은 존재하는 이메일입니다.` 
}
```

{% endtab %}
{% endtabs %}

## &#x20;user login 로그인       &#x20;

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

&#x20;로그인            &#x20;

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| email    | string | 이메일         |
| password | string | 비밀번호        |

{% tabs %}
{% tab title="200  로그인 완료
쿠키에 refreshToken 삽입 " %}

```
{
data: { 
    accessToken: accessToken 
    }, 
    
message: "로그인 완료"
}
```

{% endtab %}

{% tab title="409 1. 이메일 존재하지 않음
2\. 이메일과 비밀번호 불일치 " %}

```
// 1. 이메일 존재하지 않음
{
 message: "잘못된 이메일 입니다."
}

2. 이메일과 비밀번호 불일치
{
 message: "잘못된 비밀번호입니다."
}
```

{% endtab %}
{% endtabs %}

## user edit 유저정보변경           &#x20;

<mark style="color:orange;">`PUT`</mark> `https://www.pippy.com/user/edit`

&#x20;유저정보변경                         &#x20;

#### Headers

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| Authentication | string | Token       |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| nickname | string | 닉네임         |
| email    | string | 이메일         |
| birthDay | string | 생년월         |

{% tabs %}
{% tab title="200  1. 유저정보 변경 //
2\. 유저정보 변경내용 없음 //" %}

```
 1. 유저정보 변경
{ 
data: {
nickname : nickname,
email: email,
birthDay: birthDay
}, 
message: "정보가 변경되었습니다." 
}

2. 유저정보 변경내용 없음
{ message: `변경된 정보가 없습니다.` }
```

{% endtab %}

{% tab title="409  이메일, 닉네임 변경시 이미 있는 데이터면 아래와 같이 출력 //" %}

```
{ message: `${email}은 존재하는 이메일입니다.` }
{ message: `${nickname}은 존재하는 닉네임입니다.` }
```

{% endtab %}
{% endtabs %}

## user editpassword 비밀번호변경             &#x20;

<mark style="color:orange;">`PUT`</mark> `https://www.pippy.com/user/editpassword`

&#x20;비밀번호 변경     &#x20;

#### Headers

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| Authentication | string | Token       |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| password | string | 패스워         |

{% tabs %}
{% tab title="200   비밀번호 동일한 경우 //
비밀번호 변경 //" %}

```
{ message: `기존 비밀번호와 동일합니다. 바꾸지 않으시겠습니까?` }

{ data: newuser, message: "비밀번호가 변경되었습니다." }
```

{% endtab %}
{% endtabs %}

## &#x20;user findpassword 비밀번호 찾기       &#x20;

<mark style="color:blue;">`GET`</mark> `https://www.pippy.com/user/findpassword`

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| nickname | string | nickname    |
| email    | string | email       |
| birthDay | string | birthDay    |

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

```
```

{% endtab %}
{% endtabs %}
