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

# Agents で Drupal を使用する

Drupal アカウントを接続すると、Profound Agents で次のノードが利用できるようになります。

これらのノードは、Drupal の [JSON:API](https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi-module) モジュールと連携して動作します。コンテンツには、**リソースタイプ**(Basic、Image、Article などのエンティティタイプ)と **リソース UUID** でアクセスします。

## 利用可能なノード

<Tabs>
  <Tab title="Create Item" icon="file-plus">
    ### Create Item

    リソースタイプの新しいアイテムを作成します。

    #### 必須の入力

    * **Drupal Site** — ドロップダウンからサイトを選択します
    * **Resource type** — `node--article` などの JSON:API リソースタイプ
    * **Attributes** または **Relationships**(または両方) — フィールド値、または他のリソースへの参照を含む JSON オブジェクト。

    <Warning>
      Attributes と Relationships のどちらも含まないリクエストは拒否されます。少なくとも一方を含めてください。
    </Warning>
  </Tab>

  <Tab title="Update Item" icon="pencil">
    ### Update Item

    既存のアイテムを更新します。

    #### 必須の入力

    * **Drupal Site** — ドロップダウンからサイトを選択します
    * **Resource type** — `node--article` などの JSON:API リソースタイプ
    * **Resource UUID**
    * **Attributes** または **Relationships**(または両方) — 更新するフィールド値または参照を含む JSON オブジェクト。少なくとも一方が必要です。

    <Note>
      変更されるのは、指定した attributes と relationships のみです。
    </Note>
  </Tab>

  <Tab title="Get Item" icon="file">
    ### Get Item

    1 件のアイテムを取得します。

    #### 必須の入力

    * **Drupal Site** — ドロップダウンからサイトを選択します
    * **Resource type** — `node--article` などの JSON:API リソースタイプ
    * **Resource UUID**

    出力には、JSON:API レスポンスに含まれる attributes、relationships、メタデータを含むアイテムの完全なコンテンツが含まれます。
  </Tab>

  <Tab title="List Items" icon="list">
    ### List Items

    指定したリソースタイプのアイテムを一覧表示します。

    #### 必須の入力

    * **Drupal Site** — ドロップダウンからサイトを選択します
    * **Resource type** — `node--article` などの JSON:API リソースタイプ

    #### 任意の入力: クエリオプション

    * **Filter** — Drupal JSON:API のフィルター構文を使用した JSON オブジェクト
    * **Fields** — ノードの出力でオブジェクトごとに返すフィールド。何も指定しない場合は、すべてのフィールドが返されます
    * **Include** — 出力に含める関連エンティティのリスト(詳しくは [JSON:API ドキュメント](https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi-module/includes)をご覧ください)
    * **Sort** — 結果セットの並べ替え式
    * **Limit** — 返すアイテムの数(デフォルトは 25、最大 50)
    * **Offset** — ページネーションのオフセット(デフォルトは 0)

    出力は構造化されたアイテムの一覧で、後続のワークフローステップで使用できます。
  </Tab>
</Tabs>

***

## 主な概念

### リソースタイプ

リソースタイプは Drupal の JSON:API の命名規則に従い、エンティティタイプとバンドルを 2 つのハイフンでつないだ形式になります。

| リソースタイプ | 説明 |
| - | - |
| `node--article` | Article コンテンツタイプのノード |
| `node--page` | Basic page のノード |
| `taxonomy_term--tags` | Tags タクソノミーのターム |

<Tip>
  **List Items** を使用すると、利用可能なリソースタイプを確認し、Drupal サイトから返されるアイテムの構造を調べることができます。
</Tip>

### リソース UUID

アイテムは **UUID** で参照されます。アイテムを作成または一覧表示した際は、JSON:API レスポンスに含まれる UUID を後続のステップの **Resource UUID** として使用してください。

### Attributes と Relationships

**Create Item** と **Update Item** では、**Attributes** または **Relationships** の少なくとも一方が必要です。

* **Attributes** — タイトル、本文、ステータスなど、アイテムのフィールド値。`node--article` の attributes の例:
  ```json theme={null}
  {
    "title": "My new article",
    "body": {
      "value": "<p>Article content here.</p>",
      "format": "basic_html"
    },
    "status": true
  }
  ```
* **Relationships** — タクソノミーターム、作成者、関連ノードなど、他のリソースへの参照。

  記事にタグをリンクする relationships の例:

  ```json theme={null}
  {
    "field_tags": {
      "data": [
        { "type": "taxonomy_term--tags",
          "id": "9b2c3d4e-5f6a-7b8c-9d0e-1f2a3b4c5d6e"
        }
      ]
    }
  }
  ```

***

## 関連リソース

* [Drupal の JSON:API モジュールのドキュメント](https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi-module)
* [JSON:API 仕様](https://jsonapi.org/format/)
