# API Docs

## End Point

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/`

This endpoint&#x20;

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

```
Hello World!
```

{% endtab %}
{% endtabs %}

## Users / Sign up

<mark style="color:orange;">`PUT`</mark> `https://m0ment.be/users/signup`

sign up

#### Request Body

| Name     | Type   | Description            |
| -------- | ------ | ---------------------- |
| email    | string | User's email           |
| password | string | Password(Min Length:8) |
| nickname | string | Nickname               |

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

```
{
    isSignUp: true
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    isSignUp: false
}
```

{% endtab %}
{% endtabs %}

## Users / Login

<mark style="color:green;">`POST`</mark> `https://m0ment.be/users/login`

User Login

#### Request Body

| Name     | Type   | Description   |
| -------- | ------ | ------------- |
| email    | string | Input E-Mail  |
| password | string | User Password |

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

```
{
    isLogin: true,
    data: {
        email: "email@gmail.com",
        nickname: "nickname"
    }
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    isLogin: false,
    data: null
}
```

{% endtab %}
{% endtabs %}

## Users / Logout

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/users/logout`

User Logout

#### Headers

| Name        | Type   | Description        |
| ----------- | ------ | ------------------ |
| accessToken | string | cookie.accessToken |

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

```
{
    isLogout: true
}
```

{% endtab %}
{% endtabs %}

## Users / My Profile

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/users/profile`

My Profile

#### Headers

| Name        | Type   | Description        |
| ----------- | ------ | ------------------ |
| accessToken | string | cookie.accessToken |

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

```
{
    data: {
        avatar: null,
        email: "yourEmail@gmail.com",
        nickname: "Nickname"
    }
}        
```

{% endtab %}

{% tab title="400 Token tempered" %}

```
{
    data: null
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    data: null
}
```

{% endtab %}
{% endtabs %}

## Users / Fix My Profile

<mark style="color:purple;">`PATCH`</mark> `https://m0ment.be/users/fixmyprofile`

Fix My Profile

#### Headers

| Name        | Type   | Description       |
| ----------- | ------ | ----------------- |
| accessToken | string | User Access Token |

#### Request Body

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

{% tabs %}
{% tab title="200 Success Fix Profile" %}

```
{
    profileFix: ture
}
```

{% endtab %}

{% tab title="400 Token tempered" %}

```
{ 
    profileFix: false
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{     
    profileFix: false
}
```

{% endtab %}
{% endtabs %}

## Log / Submit

<mark style="color:orange;">`PUT`</mark> `https://m0ment.be/log/submit`

Submit Post

#### Headers

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| accessToken | string | cookie.accessToken => get user id |

#### Request Body

| Name    | Type    | Description  |
| ------- | ------- | ------------ |
| secret  | boolean | post secret  |
| content | string  | post content |
| title   | string  | post title   |

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

```
{
    isSubmit: ture
}
```

{% endtab %}

{% tab title="400 Token Tempered" %}

```
{
    isSubmit: false
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    isSubmit : false
}
```

{% endtab %}
{% endtabs %}

## Log / Fix

<mark style="color:purple;">`PATCH`</mark> `https://m0ment.be/log/fix/{id}`

Post Fix

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | Post ID     |

#### Headers

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| accessToken | string | cookie.accessToken => get user id |

#### Request Body

| Name    | Type    | Description  |
| ------- | ------- | ------------ |
| secret  | boolean | post secret  |
| content | string  | post content |
| title   | string  | post title   |

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

```
{
    isFixed: true
}
```

{% endtab %}

{% tab title="400 Token Tempered" %}

```
{
    isFixed: false
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    isFixed: false
}
```

{% endtab %}

{% tab title="404 Post Not Found" %}

```
{
    isFixed: false
}
```

{% endtab %}
{% endtabs %}

## Log / Delete

<mark style="color:red;">`DELETE`</mark> `https://m0ment.be/log/delete/{id}`

Post Delete

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | Post number |

#### Headers

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| accessToken | string | cookie.accessToken => get user id |

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

```
{
    isDel: true
}
```

{% endtab %}

{% tab title="400 Token Tempered" %}

```
{
    isDel: false
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    isDel: false
}
```

{% endtab %}

{% tab title="404 Post Not Found" %}

```
{
    idDel: false
}
```

{% endtab %}
{% endtabs %}

## Log / Recent

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/log/recent/page/{num}`

Search Recent Post (not secret)

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| num  | number | Default: 1  |

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

```
{
    "data": {
        "count": 7,
        "rows": [
            {
                "id": 14,
                "title": "폭두방랑 타나카",
                "content": "청춘은 폭발이다.",
                "updatedAt": "2021-08-31T01:52:01.000Z",
                "like_count": 1,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            },
            {
                "id": 13,
                "title": "데미안",
                "content": "새는 알에서 나오기 위해 투쟁한다. 알은 새의 세계이다. 누구든지 태어나려고 하는 자는 하나의 세계를 파괴하지 않으면 안 된다. 새는 신을 향해 날아간다. 그 신의 이름은 아브락사스이다.",
                "updatedAt": "2021-08-31T01:43:33.000Z",
                "like_count": 1,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            },
            {
                "id": 10,
                "title": "코스모스",
                "content": "이 광대한 우주 무한한 시간 속에서 당신과 같은 시간, 같은 행성 위에 살아가는 것을 기뻐하며",
                "updatedAt": "2021-08-30T15:40:31.000Z",
                "like_count": 0,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            },
            {
                "id": 9,
                "title": "귀멸의 칼날",
                "content": "렌고쿠 쿄쥬로 : 마음을 불태워라. 한계를 뛰어넘어! 나는 염주(炎柱), 렌고쿠 쿄쥬로!",
                "updatedAt": "2021-08-30T15:36:18.000Z",
                "like_count": 0,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            }
        ]
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{ 
    message: "end"
}
```

{% endtab %}
{% endtabs %}

## Log / Detail

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/log/detail/{id}`

View post detail (not secret)

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | post id     |

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

```
{
    "data": {
        "id": 8,
        "title": "What is history",
        "content": "역사란, 역사가와 그의 사실들의 끊임없는 상호작용 과정, 현재와 과거사이의 끊임없는 대화이다.",
        "author": "Sheldon",
        "updated": "2021-08-30T15:32:05.000Z",
        "like_count": 0
    }
}
```

{% endtab %}

{% tab title="404 Post Not Found" %}

```
{
    data: null
}
```

{% endtab %}
{% endtabs %}

## Log / Like

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/log/like/{id}`

User Like Post?

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | number | post id     |

#### Headers

| Name        | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| accessToken | string | cookie.accessToken => get user id |

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

```
{
    isLike : true
}
```

{% endtab %}

{% tab title="202 Cancel Like" %}

```
{
    isLike: false
}
```

{% endtab %}

{% tab title="400 Token Tempered" %}

```
{
    isLike: false
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    isLike: false
}
```

{% endtab %}
{% endtabs %}

## User / Google OAuth

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/users/google`

Google OAuth

#### Headers

| Name | Type   | Description |
| ---- | ------ | ----------- |
| code | string | callback    |

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

```
{
    isLogin: true
}
```

{% endtab %}
{% endtabs %}

## Users / FaceBook OAuth

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/users/facebook`

Facebook OAuth

#### Headers

| Name | Type   | Description |
| ---- | ------ | ----------- |
| code | string | callback    |

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

```
{
    isLogin : true
}
```

{% endtab %}
{% endtabs %}

## Log / My Post

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/log/mypost/{num}`

Search My Posts

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| num  | number | Default: 1  |

{% tabs %}
{% tab title="200 View My Post" %}

```
{
    "data": {
        "count": 7,
        "rows": [
            {
                "id": 14,
                "title": "폭두방랑 타나카",
                "content": "청춘은 폭발이다.",
                "updatedAt": "2021-08-31T01:52:01.000Z",
                "like_count": 1,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            },
            {
                "id": 13,
                "title": "데미안",
                "content": "새는 알에서 나오기 위해 투쟁한다. 알은 새의 세계이다. 누구든지 태어나려고 하는 자는 하나의 세계를 파괴하지 않으면 안 된다. 새는 신을 향해 날아간다. 그 신의 이름은 아브락사스이다.",
                "updatedAt": "2021-08-31T01:43:33.000Z",
                "like_count": 1,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            },
            {
                "id": 10,
                "title": "코스모스",
                "content": "이 광대한 우주 무한한 시간 속에서 당신과 같은 시간, 같은 행성 위에 살아가는 것을 기뻐하며",
                "updatedAt": "2021-08-30T15:40:31.000Z",
                "like_count": 0,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            },
            {
                "id": 9,
                "title": "귀멸의 칼날",
                "content": "렌고쿠 쿄쥬로 : 마음을 불태워라. 한계를 뛰어넘어! 나는 염주(炎柱), 렌고쿠 쿄쥬로!",
                "updatedAt": "2021-08-30T15:36:18.000Z",
                "like_count": 0,
                "user_id": 6,
                "User": {
                    "nickname": "Sheldon"
                }
            }
        ]
    }
}  
```

{% endtab %}

{% tab title="400 Token Tempered" %}

```
{
    data: null
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    data: null
}
```

{% endtab %}

{% tab title="404 Not Found Posts" %}

```
{
    message: "end"
}
```

{% endtab %}
{% endtabs %}

## Log / My Post Detail

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/log/mypostdetail/{id}`

View My Post Detail

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | post Id     |

#### Headers

| Name        | Type   | Description                    |
| ----------- | ------ | ------------------------------ |
| accessToken | string | cookie.accessToken =>  user Id |

{% tabs %}
{% tab title="200 View My Post " %}

```
{
    "data": {
        "id": 7,
        "title": "빅뱅이론",
        "content": "Sheldon: I'm not crazy. My mother had me tested.",
        "author": "Sheldon",
        "updated": "2021-08-30T15:14:38.000Z",
        "like_count": 0
    }
}
```

{% endtab %}

{% tab title="400 Token Tempered" %}

```
{
    data: null
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    data: null
}
```

{% endtab %}

{% tab title="404 Not Found Post" %}

```
{
    data: null
}
```

{% endtab %}
{% endtabs %}

## Log / User Is Like

<mark style="color:blue;">`GET`</mark> `https://m0ment.be/log/userislike`

View User Is Like

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | post Id     |

#### Headers

| Name        | Type   | Description                   |
| ----------- | ------ | ----------------------------- |
| accessToken | string | cookie.accessToken => user Id |

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

```
{
    userLikePost: true
}
```

{% endtab %}

{% tab title="400 Tempered Token" %}

```
{
    userLikePost: false
}
```

{% endtab %}

{% tab title="401 Invalid Token" %}

```
{
    userLikePost: false
}
```

{% endtab %}

{% tab title="404 Not Found Like" %}

```
{
    userLikePost: false
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mmm-4.gitbook.io/kd/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
