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

# QnA

## 상세 요청

<mark style="color:blue;">`GET`</mark> `/qna/detail/:id`

#### Query Parameters

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

{% tabs %}
{% tab title="201: Created " %}

```javascript
{
    // Response
    "message": "QnA 상세정보 요청 성공"
}
```

{% endtab %}
{% endtabs %}

## 질문 등록

<mark style="color:green;">`POST`</mark> `/qna/upload`

#### Cookies

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

#### Request Body

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| title<mark style="color:red;">\*</mark>     | String | title       |
| content<mark style="color:red;">\*</mark>   | String | content     |
| users\_id<mark style="color:red;">\*</mark> | int    | userId      |
| category<mark style="color:red;">\*</mark>  | String | category    |
| hashtag                                     | String | hashtag     |

{% tabs %}
{% tab title="201: Created 질문 등록 완료" %}

```javascript
{
    // Response
    "message": "질문 등록 성공"
}
```

{% endtab %}

{% tab title="401: Unauthorized 토큰이 유효하지 않을 때" %}

```javascript
{
    // Response
    "message": "토큰이 유효하지 않음"
}
```

{% endtab %}

{% tab title="400 빈값이 있을 때" %}

```javascript
{
    // Response
    "message": "잘못된 요청"
}
```

{% endtab %}
{% endtabs %}

## 질문 정보 받아오기

<mark style="color:green;">`POST`</mark> `/qna/info`

{% tabs %}
{% tab title="200: OK 질문 정보 요청 완료" %}

```javascript
{
    // Response
    "message": "QnA 정보 요청 성공"
}
```

{% endtab %}

{% tab title="401: Unauthorized 토큰이 유효하지 않을 때" %}

```javascript
{
    // Response
    "message": "토큰이 유효하지 않음"
}
```

{% endtab %}
{% endtabs %}

## 질문 수정

<mark style="color:orange;">`PUT`</mark> `/qna/modify`

#### Cookies

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

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| title    | String | title       |
| content  | String | content     |
| category | String |             |

{% tabs %}
{% tab title="200: OK 질문 수정 완료" %}

```javascript
{
    // Response
    "message": "QnA 수정 성공"
}
```

{% endtab %}

{% tab title="401: Unauthorized 토큰이 유효하지 않을 때" %}

```javascript
{
    // Response
    "message": "토큰이 유효하지 않음"
}
```

{% endtab %}

{% tab title="403: Forbidden 자신의 질문이 아닐 때" %}

```javascript
{
    // Response
    "message": "권한이 없음"
}
```

{% endtab %}
{% endtabs %}

## 질문 삭제

<mark style="color:red;">`DELETE`</mark> `/qna`

#### Cookies

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

#### Request Body

| Name | Type | Description |
| ---- | ---- | ----------- |
| id   | int  | userId      |

{% tabs %}
{% tab title="200: OK 질문 삭제완료" %}

```javascript
{
    // Response
    "message": "QnA 삭제 성공"
}
```

{% endtab %}

{% tab title="401: Unauthorized 토큰이 유효하지 않을 때" %}

```javascript
{
    // Response
    "message": "토큰이 유효하지 않음"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://apang.gitbook.io/apang/qna.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
