Box Developerドキュメント
最新バージョン

Manage Box Hub items

post
https://api.box.com/2.0
/hubs/:hub_id/manage_items

Adds and/or removes Box Hub items from a Box Hub.

リクエスト

bearer [ACCESS_TOKEN]
application/json

リクエストヘッダー

stringヘッダー内必須

Version header.

次の値に固定: 2025.0

パスパラメータ

stringパス内必須
12345

Hubを表す一意の識別子。

HubのIDを確認するには、ウェブアプリでこのHubにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/hubs/123の場合、hub_id123です。

リクエスト本文

object array本文内省略可能

List of operations to perform on Box Hub items.

string本文内条件付きで必須
"add"

The action to perform on a Box Hub item.

次の値のいずれか1つ: add,remove

object object本文内

Reference to an item that can be added to a Box Hub.

レスポンス

すべての操作のステータスを取得します。

Authorizationヘッダーで指定されているアクセストークンが認識されないか、指定されていない場合に返されます。

Returned if the Box Hub is not found, or the user does not have access to the Box Hub.

予期しないクライアントエラー。

post
Manage Box Hub items
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

TypeScript Gen
await client.hubItems.manageHubItemsV2025R0(createdHub.id, {
  operations: [
    {
      action: 'add' as HubItemOperationV2025R0ActionField,
      item: new FolderReferenceV2025R0({ id: folder.id }),
    } satisfies HubItemOperationV2025R0,
  ],
} satisfies HubItemsManageRequestV2025R0);
Python Gen
client.hub_items.manage_hub_items_v2025_r0(
    created_hub.id,
    operations=[
        HubItemOperationV2025R0(
            action=HubItemOperationV2025R0ActionField.ADD,
            item=FolderReferenceV2025R0(id=folder.id),
        )
    ],
)
.NET Gen
await client.HubItems.ManageHubItemsV2025R0Async(hubId: createdHub.Id, requestBody: new HubItemsManageRequestV2025R0() { Operations = Array.AsReadOnly(new [] {new HubItemOperationV2025R0(action: HubItemOperationV2025R0ActionField.Add, item: new FolderReferenceV2025R0(id: folder.Id))}) });

レスポンスの例

{
  "operations": [
    {
      "action": "add",
      "error": "Item not found",
      "item": {
        "id": "42037322",
        "type": "file"
      },
      "status": 200
    }
  ]
}