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

# Members API

## Sign Up (회원가입)

<mark style="color:green;">`POST`</mark> `https://younghoonjean.com/api/members/signup/`

&#x20;로컬 계정을 생성하는 회원가입 API입니다.\
\
이메일은 반드시 일반적인 이메일 형식에 맞게 작성되어야 합니다.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name          | Type   | Description                                |
| ------------- | ------ | ------------------------------------------ |
| username      | string | input user ID                              |
| password      | string | input user password                        |
| last\_name    | string | input user last name                       |
| first\_name   | string | input user first name                      |
| email         | string | input user email( ex) <test001@gmail.com>) |
| phone\_number | string | input user phonenumber                     |

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

```javascript
{
    "pk":4,
    "username":"testaccount3",
    "password":"pbkdf2_sha256$120000$X9IZZRsGO3Xk$H6P6HVkcxaKWLPvb5cVgnQ8wi4xD6uKJvYsfxGtYV18=",
    "last_name":"test",
    "first_name":"004",
    "email":"test003@gmail.com",
    "phone_number":"01000000004"
}
```

{% endtab %}
{% endtabs %}

## Check Unique Username(ID 중복검사)

<mark style="color:green;">`POST`</mark> `https://younghoonjean.com/api/members/checkID/`

username 중복검사입니다.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name     | Type   | Description                      |
| -------- | ------ | -------------------------------- |
| username | string | input username you want to check |

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

```javascript
{
    "username":"testaccount4",
    "message":"사용 가능한 아이디입니다."
}

```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "message": '이미 존재하는 아이디입니다.'
}
```

{% endtab %}
{% endtabs %}

## Sign in(Login, 로그인)

<mark style="color:green;">`POST`</mark> `https://younghoonjean.com/api/members/login/`

login에 성공하면 token이 주어집니다.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

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

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

```javascript
{
    "token":"7627555aae9c37b6e48367c1737818103ab771b7"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
```

{% endtab %}
{% endtabs %}

## Soical Sign up\&Sign in (소셜 회원가입/로그인)

<mark style="color:green;">`POST`</mark> `https://younghoonjean.com/api/members/social-login/`

password는 자동 생성됩니다.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| user\_id      | string | user\_id as username(ID) |
| last\_name    | string | input last name          |
| first\_name   | string | input first name         |
| email         | string | input user email         |
| phone\_number | string | input phone\_number      |

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

```javascript
{
    "token":"7627555aae9c37b6e48367c1737818103ab771b7"
}
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}
{% endtabs %}

## User Profile(GET method : 유저 정보 조회)

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/members/profile/`

회원정보 조회입니다. 로그인 시 전달받은 token값을 Header에 전달해야합니다.

#### Headers

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

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

```javascript
{
    "pk":1,
    "username":"hanoul",    
    "password":"pbkdf2_sha256$120000$01vrFFycAqCw$zosSawuPgTTA4TUAC8frIyqhx7R89T+NRA5r/qObwBY=",
    "last_name":"kim",
    "first_name":"hanoul",
    "email":"",
    "phone_number":""
}

```

{% endtab %}
{% endtabs %}

## User Profile(PATCH method : 유저 정보 수정)

<mark style="color:purple;">`PATCH`</mark> `https://younghoonjean.com/api/members/profile/`

회원정보 수정입니다. 해당 URL로 GET요청을 하여 받은 유저정보를 바탕으로, 수정한 값을 PATCH로 전달합니다.\
\
username의 경우는 수정할 경우 Unique Constraint를 발생할 위험이 있으므로, 수정을 막는 편이 좋습니다.

#### Headers

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| Autorization | string | token \<token key> |
| Content-Type | string | application/json   |

#### Request Body

| Name          | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| username      | string | input username                        |
| password      | string | input password you want to change     |
| first\_name   | string | input first name you want to change   |
| last\_name    | string | input last name you want to change    |
| email         | string | input email you want to change        |
| phone\_number | string | input phone number you want to change |

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

```javascript
{
    "pk":1,
    "username":"hanoul",
    "password":"pbkdf2_sha256$120000$01vrFFycAqCw$zosSawuPgTTA4TUAC8frIyqhx7R89T+NRA5r/qObwBY=",
    "last_name":"kim",
    "first_name":"hanoul",
    "email":"",
    "phone_number":""
}
```

{% endtab %}
{% endtabs %}

## Logout (Terminate Token, 로그아웃)

<mark style="color:red;">`DELETE`</mark> `https://younghoonjean.com/api/members/logout/`

로그아웃입니다. Header에 전달한 Token이 파기됩니다.

#### Headers

| Name         | Type   | Description        |
| ------------ | ------ | ------------------ |
| Autorization | string | token \<token key> |

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

```
```

{% endtab %}
{% endtabs %}

## User List

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/members/user-list/`

등록된 모든 유저 리스트를 보여줍니다.

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

```
[
    {
        "pk":1,
        "username":"hanoul",
        "password":"pbkdf2_sha256$120000$01vrFFycAqCw$zosSawuPgTTA4TUAC8frIyqhx7R89T+NRA5r/qObwBY=",
        "lastName":"kim",
        "firstName":"hanoul",
        "email":"","phoneNumber":""
    },
    {
        "pk":2,
        "username":"tester01",
        "password":"pbkdf2_sha256$120000$XhO1cClRcW6a$CUah3xkm7DUpQ5nx+kcKyUxTeLoH3rI/DoA0coShGss=",
        "lastName":"",
        "firstName":"",
        "email":"",
        "phoneNumber":""
    }
]
```

{% endtab %}
{% endtabs %}

## Check Password(for Profile access)

<mark style="color:green;">`POST`</mark> `https://younghoonejean.com/api/memebers/check-password/`

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Content-Type  | string | application/json   |
| Authorization | string | token \<token key> |

#### Request Body

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| password | string | input user password |

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

```
{
    "message": "인증에 성공했습니다."
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "message": "인증에 실했습니다."
}
```

{% endtab %}
{% endtabs %}

## User Account Delete

<mark style="color:red;">`DELETE`</mark> `https://younghoonjean.com/api/members/user-delete/`&#x20;

&#x20;유저 삭제 api 삭제가 완료되면 status.204&#x20;

#### Headers

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

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

```
```

{% endtab %}
{% endtabs %}

## GET User Reservation History

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/members/reservations/1/`

로그인 한 유저의 모든 예매 기록을 가져옵니다.

#### Headers

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

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

```
```

{% endtab %}
{% endtabs %}

## Cancel User Reservation

<mark style="color:purple;">`PATCH`</mark> `https://younghoonjean.com/api/members/reservations/<int:pk>/`

u유저가 예매한 티켓을 비활성화합니다.\
int값(예매번호= 티켓 pk값)을 전달받습니다.

#### Path Parameters

| Name           | Type    | Description                             |
| -------------- | ------- | --------------------------------------- |
| reservation pk | integer | ticket number(=reservation instance pk) |

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

```
```

{% endtab %}
{% endtabs %}
