> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# クエリでの optionalFields の使用

> optionalFields クエリパラメーターを使用して、Automation API エンドポイントからデフォルトでは返されない追加フィールドをリクエストします。

## 概要

デフォルトでは、一部のエンドポイントはリソースリクエスト時にすべてのフィールドを返しません。
これらの追加フィールドを取得するには、`optionalFields` クエリパラメーターでそれらを指定します。

このガイドでは、例として [Get All Feature Flags](/api-reference/featureflag/get-all-feature-flags) エンドポイントを使用して、**オプションフィールドのリクエスト方法**を示します。

## optionalFields のリクエスト

### 例 1: optionalFields なしのクエリ

#### リクエスト

```bash theme={null}
curl -L -X GET 'https://api.kameleoon.com/feature-flags' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

#### レスポンス

```json theme={null}
[
  {
    "id": 395,
    "featureKey": "plp___4_products_per_row",
    "name": "PLP : 4 products per row",
    "description": "",
    "tags": [],
    ...
  },
  ...
]
```

`tags` フィールドが空であることに注意してください。
**オプションフィールドは、明示的にリクエストされない限り、空の値を返します。**

### 例 2: tags フィールドを含むクエリ

#### リクエスト

<Note>
  `optionalFields` パラメーターでカンマ区切りにして指定することで、複数のオプションフィールドをリクエストできます。
  たとえば、`optionalFields=tags,description` のように使用します。
</Note>

```bash theme={null}
curl -L -X GET 'https://api.kameleoon.com/feature-flags?optionalFields=tags' \
  -H 'Content-Type: application/json' \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
```

#### レスポンス

```json theme={null}
[
  {
    "id": 395,
    "featureKey": "plp___4_products_per_row",
    "name": "PLP : 4 products per row",
    "description": "",
    "tags": [
      "product page"
    ],
    ...
  },
  ...
]
```
