日本時間5月16日のContent Cloud Summitで、カスタムアプリにBox AI APIを活用する方法を紹介します。

詳細を表示

ユーザーのWebhookのリストを取得

ガイド Webhook V2 Webhook ユーザーのWebhookのリストを取得

ユーザーのWebhookのリストを取得

認証済みユーザーのすべてのWebhookを取得するには、すべてのWebhookのリストを取得エンドポイントを使用します。

cURL
curl -i -X GET "https://api.box.com/2.0/webhooks" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxCollectionMarkerBased<BoxWebhook> webhooks = await client.WebhooksManager.GetWebhooksAsync();
Java
Iterable<BoxWebHook.Info> webhooks = BoxWebHook.all(api);
for (BoxWebHook.Info webhookInfo: webhooks) {
    // Do something with the webhook.
}
Python
webhooks = client.get_webhooks()
for webhook in webhooks:
    print(f'The webhook ID is {webhook.id} and the address is {webhook.address}')
Node
client.webhooks.getAll()
	.then(webhooks => {
		/* webhooks -> {
			next_marker: 'ZmlQZS0xLTE%3D',
			entries: 
			[ { id: '1234',
				type: 'webhook',
				target: { id: '22222', type: 'folder' } },
				{ id: '5678',
				type: 'webhook',
				target: { id: '11111', type: 'file' } } ],
			limit: 2 }
		*/
	});
iOS
let iterator = client.webhooks.list()
iterator.next { results in
    switch results {
    case let .success(page):
        for webhook in page.entries {
            print("Webhook \(webhook.id) was created at \(webhook.createdAt)")
        }

    case let .failure(error):
        print(error)
    }
}

このエンドポイントを使用するには、アプリケーションの [Webhookを管理する] スコープが有効になっている必要があります。

このAPIコールは、認証済みユーザーのWebhookのみをリストし、会社内の他のユーザーのWebhookはリストしません。