# Create FAQs

This API is used to create FAQs.

**Notice**：Notes: <br>
If user_access_token is used, the operator needs to be an agent, administrator or owner of the current Help Desk

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/faqs
HTTP Method | POST
Rate Limit | [Special Rate Limit](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Update resources details of Help Desk(helpdesk:all)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `user_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

**Notice**：The "Help Desk token" parameter also needs to be added to the Help Desk request header:

Key: X-Lark-Helpdesk-Authorization

Value: base64(helpdesk_id:helpdesk_token), a base64-encrypted string that connects helpdesk_id and helpdesk_token with ':'.

[Learn more about how to obtain and use Help Desk token](https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN)

### Request body

Parameter | Type | Required | Description
---|---|---|---
faq | faq_update_info | No | FAQs details
category_id | string | No | FAQs category ID<br>**Example value**: "6836004780707807251"
question | string | Yes | Question<br>**Example value**: "Question"
answer | string | No | Answer<br>**Example value**: "Answer"
answer_richtext | string | No | Either the rich text answer or the answer is required, in the Json array format. For the rich text structure, see [Learn more about rich text](https://open.feishu.cn/document/ukTMukTMukTM/uITM0YjLyEDN24iMxQjN)<br>**Example value**: "[{\"content\":\"Answer\",\"type\":\"text\"},{\"content\":\"Obtain medical insurance question\",\"type\":\"text\"}]"
tags | string\[\] | No | Similar question<br>**Example value**: ["Similar questions"]

### Request body example
```json
{
    "faq": {
        "category_id": "6836004780707807251",
        "question": "Question",
        "answer": "Answer",
        "answer_richtext": "[{\"content\":\"Answer\",\"type\":\"text\"},{\"content\":\"Obtain medical insurance question\",\"type\":\"text\"}]",
        "tags": [
            "Similar questions"
        ]
    }
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
faq | faq | FAQs details
faq_id | string | FAQs ID
id | string | For the legacy FAQs ID, use faq_id
helpdesk_id | string | Help Desk ID
question | string | Question
answer | string | Answer
answer_richtext | richtext\[\] | Rich text answer
content | string | Content
type | string | Type
create_time | int | Creation time
update_time | int | Modification time
categories | category\[\] | Category
category_id | string | FAQs category ID
id | string | FAQs category ID (for old versions, use category_id)
name | string | Name
parent_id | string | Parent FAQs category ID
helpdesk_id | string | Help Desk ID
language | string | Language
tags | string\[\] | List of similar questions
expire_time | int | Expiration time
update_user | ticket_user | Updated by
id | string | User ID
avatar_url | string | URL of user's profile photo
name | string | User name
department | string | User Department
city | string | User City
country | string | User Country
create_user | ticket_user | Creator
id | string | User ID
avatar_url | string | URL of user's profile photo
name | string | User name
department | string | User Department
city | string | User City
country | string | User Country

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "faq": {
            "faq_id": "6936004780707807231",
            "id": "6936004780707807231",
            "helpdesk_id": "6936004780707807251",
            "question": "Question",
            "answer": "Answer",
            "answer_richtext": [
                {
                    "content": "Obtain medical insurance question",
                    "type": "text"
                }
            ],
            "create_time": 1596379008,
            "update_time": 1596379008,
            "categories": [
                {
                    "category_id": "6948728206392295444",
                    "id": "6948728206392295444",
                    "name": "Create a team and invite members",
                    "parent_id": "0",
                    "helpdesk_id": "6939771743531696147",
                    "language": "zh_cn"
                }
            ],
            "tags": [
                "Similar questions"
            ],
            "expire_time": 1596379008,
            "update_user": {
                "id": "ou_37019b7c830210acd88fdce886e25c71",
                "avatar_url": "https://xxxx",
                "name": "ABC",
                "department": "xx",
                "city": "xx",
                "country": "xxx"
            },
            "create_user": {
                "id": "ou_37019b7c830210acd88fdce886e25c71",
                "avatar_url": "https://xxxx",
                "name": "ABC",
                "department": "xx",
                "city": "xx",
                "country": "xxx"
            }
        }
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 154000 | Bad request, please check your request body | Invalid request. Check the parameters.
500 | 155000 | Internal error | Internal error, please contact us

