ガイドWebhookWebhookの管理すべてのWebhookのリストを取得

すべてのWebhookのリストを取得

すべてのWebhookのリストを取得

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

cURL
curl -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('The webhook ID is {0} and the address is {1}'.format(webhook.id, 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
client.webhooks.list() { results in
    switch results {
    case let .success(iterator):
        for i in 1 ... 10 {
            iterator.next { result in
                switch result {
                case let .success(webhook):
                    print("Webhook \(webhook.id) was created at \(webhook.createdAt)")
                case let .failure(error):
                    print(error)
                }
            }
        }
    case let .failure(error):
        print(error)
    }
}

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

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