# Obtain all custom fields of ticket

This API is used to obtain all custom ticket fields.

##  Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/ticket_customized_fields
HTTP Method | GET
Supported app types | Custom App
Required scopes<br>**The scopes required to call this API. You can call the API with any of the scopes.** | $$$helpdesk.v1.scope.helpdesk.v1.scope.helpdesk:all:readonly.desc.desc$$$(helpdesk:all:readonly)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[Learn more about how to obtain and use access_token](https://open.feishu.cn/document/ukTMukTMukTM/uMTNz4yM1MjLzUzM)
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)

###  Query parameters

Parameter | Type | Required | Description
---|---|---|---
page_token | string | No | Paging token. No value at the first request indicates traversal from the beginning. When the paging query involves more results, a new page_token will be returned, which can be used to obtain more results in the next traversal.<br>**Example value**: "6948728206392295444"
page_size | int | No | Page size<br>**Example value**: 10; Default value: 20<br>**Data validation rules**:<br>- Maxpoint: `100`

### Request body

Parameter | Type | Required | Description
---|---|---|---
visible | boolean | No | Visible<br>**Example value**: true

### Request body example

```json
{
    "visible": true
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error code. A value other than 0 indicates failure.
msg | string | Error description
data | \- | \-
&emsp;∟&nbsp;has_more | boolean | Indicates whether there are more options
&emsp;∟&nbsp;next_page_token | string | Next paging token
&emsp;∟&nbsp;items | ticket_customized_field\[\] | List of custom ticket fields
&emsp;&emsp;∟&nbsp;ticket_customized_field_id | string | ID of custom fields of ticket
&emsp;&emsp;∟&nbsp;helpdesk_id | string | Help Desk ID
&emsp;&emsp;∟&nbsp;key_name | string | Key name
&emsp;&emsp;∟&nbsp;display_name | string | Name to display
&emsp;&emsp;∟&nbsp;position | string | Used to search for FAQs by keyword (similar question), question title, content, and user name
&emsp;&emsp;∟&nbsp;field_type | string | Type
&emsp;&emsp;∟&nbsp;description | string | Description
&emsp;&emsp;∟&nbsp;visible | boolean | Visible
&emsp;&emsp;∟&nbsp;editable | boolean | Editable
&emsp;&emsp;∟&nbsp;required | boolean | Required or not
&emsp;&emsp;∟&nbsp;created_at | string | Created at
&emsp;&emsp;∟&nbsp;updated_at | string | Last update
&emsp;&emsp;∟&nbsp;created_by | ticket_user | Creator
&emsp;&emsp;&emsp;∟&nbsp;id | string | UserID
&emsp;&emsp;&emsp;∟&nbsp;avatar_url | string | User‘s profile photourl
&emsp;&emsp;&emsp;∟&nbsp;name | string | User name
&emsp;&emsp;&emsp;∟&nbsp;email | string | User's email
&emsp;&emsp;∟&nbsp;updated_by | ticket_user | Updated by
&emsp;&emsp;&emsp;∟&nbsp;id | string | UserID
&emsp;&emsp;&emsp;∟&nbsp;avatar_url | string | URL of user's profile photo
&emsp;&emsp;&emsp;∟&nbsp;name | string | User name
&emsp;&emsp;&emsp;∟&nbsp;email | string | User's email
&emsp;&emsp;∟&nbsp;dropdown_options | dropdown_option | Options in the drop-down list
&emsp;&emsp;&emsp;∟&nbsp;children | dropdown_option[] | Option list
&emsp;&emsp;&emsp;&emsp;∟&nbsp;tag | string | Option ID
&emsp;&emsp;&emsp;&emsp;∟&nbsp;display_name | string | Name
&emsp;&emsp;&emsp;&emsp;∟&nbsp;children | dropdown_option[] | Options for multi-level drop-downs only (at most three levels of drop-downs are supported)
&emsp;&emsp;∟&nbsp;dropdown_allow_multiple | boolean | Specifies whether multiple choices are supported, valid only when the field type is dropdown dropdown

### Response body example

```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "has_more": true,
        "next_page_token": "6948728206392295444",
        "items": [
            {
                "ticket_customized_field_id": "6834320707288072194",
                "helpdesk_id": "1542164574896126",
                "key_name": "test dropdown",
                "display_name": "test dropdown",
                "position": "3",
                "field_type": "dropdown",
                "description": "Drop-down example",
                "visible": true,
                "editable": true,
                "required": false,
                "created_at": "1591239289000",
                "updated_at": "1591239289000",
                "created_by": {
                    "id": "ou_37019b7c830210acd88fdce886e25c71",
                    "avatar_url": "https://xxxx",
                    "name": "abc",
                    "email": "xxxx@abc.com"
                },
                "updated_by": {
                    "id": "ou_37019b7c830210acd88fdce886e25c71",
                    "avatar_url": "https://xxxx",
                    "name": "abc",
                    "email": "xxxx@abc.com"
                },
                "dropdown_options": {
                    "children": [
                        {
                            "tag": "c495fe14-aac0-4fd6-8851-9fde726e2a40",
                            "display_name": "l1",
                            "children": [
                                {
                                    "tag": "498ed5f1-f2b1-4585-b21f-3d4d2cd0cd26",
                                    "display_name": "l2"
                                },
                                {
                                    "tag": "51285604-367f-454f-adca-b4760c38850d",
                                    "display_name": "l22"
                                }
                            ]
                        },
                        {
                            "tag": "295cf315-df56-445b-b430-b58925ef331c",
                            "display_name": "l11"
                        }
                    ]
                },
                "dropdown_allow_multiple": true
            }
        ]
    }
}
```

### Error code

HTTPStatus code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 154000 | Bad request, please check your request body | Invalid request. Check the parameters.
401 | 154001 | Unauthorized, please check you have the correct access | Check if Authorization and X-Lark-Helpdesk-Authorization are correct and the app and Help Desk belong to the same tenant.
403 | 154003 | Please check you have the correct access | Check if the correct permission scope is requested.
500 | 155000 | Internal error | Contact us.

