Box Developerドキュメント
ベータ

Hubコラボレーションを作成

post
https://api.box.com/2.0
/hub_collaborations

Hubに個々のユーザーまたはグループのコラボレーションを追加します。

コラボレーションは、メールアドレス、ユーザーID、またはグループIDを使用して作成できます。

リクエスト

bearer [ACCESS_TOKEN]
application/json

リクエストヘッダー

stringヘッダー内必須

Version header.

次の値に固定: 2025.0

リクエスト本文

object本文内

その項目へのアクセス権限を取得するユーザーまたはグループ。

string本文内必須
"23522323"

ユーザーまたはグループのID。

loginを使用してメールアドレスでユーザーを指定することもできます。

string本文内必須
"user"

招待するコラボレータの種類。使用可能な値はuserまたはgroupです。

string本文内必須
"john@example.com"

項目に対するアクセス権限を取得するユーザーのメールアドレス。

idを使用してユーザーIDでユーザーを指定することもできます。

object本文内

Hubsの参照。

string本文内必須
"42037322"

オブジェクトのID。

string本文内必須
"hubs"

値は常にhubsになります。

次の値に固定: hubs

string本文内必須
"editor"

Hubに付与されるアクセスレベル。使用可能な値はeditorviewerco-ownerです。

レスポンス

新しいHubコラボレーションオブジェクトを返します。

ユーザーにコラボレーションを作成するための適切な権限がない場合にエラーを返します。

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

post
Hubコラボレーションを作成
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

TypeScript Gen
await client.hubCollaborations.createHubCollaborationV2025R0({
  hub: new HubCollaborationCreateRequestV2025R0HubField({ id: hub.id }),
  accessibleBy: {
    type: 'user',
    id: user.id,
  } satisfies HubCollaborationCreateRequestV2025R0AccessibleByField,
  role: 'viewer',
} satisfies HubCollaborationCreateRequestV2025R0);
Python Gen
client.hub_collaborations.create_hub_collaboration_v2025_r0(
    CreateHubCollaborationV2025R0Hub(id=hub.id),
    CreateHubCollaborationV2025R0AccessibleBy(type="user", id=user.id),
    "viewer",
)
.NET Gen
await client.HubCollaborations.CreateHubCollaborationV2025R0Async(requestBody: new HubCollaborationCreateRequestV2025R0(hub: new HubCollaborationCreateRequestV2025R0HubField(id: hub.Id), accessibleBy: new HubCollaborationCreateRequestV2025R0AccessibleByField(type: "user") { Id = user.Id }, role: "viewer"));

レスポンスの例

{
  "id": "12345678",
  "type": "hub_collaboration",
  "acceptance_requirements_status": {
    "strong_password_requirement": {
      "enterprise_has_strong_password_required_for_external_users": true,
      "user_has_strong_password": true
    },
    "terms_of_service_requirement": {
      "is_accepted": true,
      "terms_of_service": {
        "id": "11446498",
        "type": "terms_of_service"
      }
    },
    "two_factor_authentication_requirement": {
      "enterprise_has_two_factor_auth_enabled": true,
      "user_has_two_factor_authentication_enabled": true
    }
  },
  "accessible_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "hub": {
    "id": "12345",
    "type": "hubs"
  },
  "role": "editor",
  "status": "accepted"
}