Box Developerドキュメント
ベータ

Create Teams integration mapping

post
https://api.box.com/2.0
/integration_mappings/teams

このエンドポイントはバージョン2024.0です。引き続き使用するために 変更は必要ありません。詳細については、 **Box APIのバージョン管理**を参照してください。

Creates a Teams integration mapping by mapping a Teams channel to a Box item. You need Admin or Co-Admin role to use this endpoint.

リクエスト

bearer [ACCESS_TOKEN]
application/json

リクエスト本文

object本文内

パートナーアプリのドメインのオブジェクト (partner_item_idで参照) のマッピング先であるBoxフォルダ

string本文内必須
"42037322"

フォルダのID

string本文内必須
"folder"

folder

次の値に固定: folder

object本文内

The schema for an integration mapping mapped item object for type Teams.

string本文内必須
"19%ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2"

(typeで参照されるタイプの) マッピングされた項目のID

string本文内必須
"channel"

idで参照されるマッピングされた項目のタイプ

次の値のいずれか1つ: channel,team

string本文内必須
"hjgjgjg-bhhj-564a-b643-hghgj685u"

ID of the team that is registered with Microsoft Teams.

string本文内必須
"abcd-defg-1235-7890"

ID of the tenant that is registered with Microsoft Teams.

レスポンス

作成された統合マッピングを返します。

誤ったoptionsが指定された場合またはBoxフォルダをこのpartner_item_idにマッピングできない場合にbad_requestを返します。エラーコードは以下のとおりです。

  • SERVICE_ACCOUNT_IS_NOT_A_COOWNER_OR_OWNER - サービスアカウントに共同所有者のコラボレーションがないか、サービスアカウントがbox_item_idの所有者ではありません。
  • CHANNEL_ALREADY_MAPPED - チャンネルがすでに別のbox_item_idにマッピングされています。
  • TEAM_ALREADY_MAPPED - team is already mapped to another box_item_id,
  • BOX_ENTERPRISE_MISMATCH - Box folder must be owned by the enterprise, which is configured to use Box as Content layer for Teams,
  • BOX_FOLDER_EXTERNALLY_OWNED - Box folder must be internally owned to the admin's enterprise
  • FOLDER_ALREADY_MAPPED - Box folder must not be mapped to another integration mapping.

Returns a not_found error if the integration mapping, record or folder could not be found.

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

post
Create Teams integration mapping
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

TypeScript Gen
await userClient.integrationMappings.createTeamsIntegrationMapping({
  partnerItem: {
    type: 'channel' as IntegrationMappingPartnerItemTeamsCreateRequestTypeField,
    id: partnerItemId,
    tenantId: tenantId,
    teamId: teamId,
  } satisfies IntegrationMappingPartnerItemTeamsCreateRequest,
  boxItem: new FolderReference({ id: folder.id }),
} satisfies IntegrationMappingTeamsCreateRequest);
Python Gen
user_client.integration_mappings.create_teams_integration_mapping(
    IntegrationMappingPartnerItemTeamsCreateRequest(
        type=IntegrationMappingPartnerItemTeamsCreateRequestTypeField.CHANNEL,
        id=partner_item_id,
        tenant_id=tenant_id,
        team_id=team_id,
    ),
    FolderReference(id=folder.id),
)
.NET Gen
await userClient.IntegrationMappings.CreateTeamsIntegrationMappingAsync(requestBody: new IntegrationMappingTeamsCreateRequest(partnerItem: new IntegrationMappingPartnerItemTeamsCreateRequest(type: IntegrationMappingPartnerItemTeamsCreateRequestTypeField.Channel, id: partnerItemId, tenantId: tenantId, teamId: teamId), boxItem: new FolderReference(id: folder.Id)));

レスポンスの例

{
  "id": "12345",
  "type": "integration_mapping",
  "box_item": {
    "id": "42037322",
    "type": "folder"
  },
  "created_at": "2012-12-12T10:53:43-08:00",
  "integration_type": "teams",
  "is_overridden_by_manual_mapping": true,
  "modified_at": "2012-12-12T10:53:43-08:00",
  "partner_item": {
    "id": "19%3ABCD-Avgfggkggyftdtfgghjhkhkhh%40thread:tacv2",
    "type": "channel",
    "team_id": "hjgjgjg-bhhj-564a-b643-hghgj685u",
    "tenant_id": "E1234567"
  }
}