lynx   »   [go: up one dir, main page]

Box Developer Documentation

List Webhooks for a User

List Webhooks for a User

To fetch all webhooks for the authenticated user, use the list all webhooks endpoint.

cURL
curl -i -X GET "https://api.box.com/2.0/webhooks" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.webhooks.getWebhooks();
Python v10
client.webhooks.get_webhooks()
.NET v10
await client.Webhooks.GetWebhooksAsync();
Swift v10
try await client.webhooks.getWebhooks()
Java v10
client.getWebhooks().getWebhooks()
Java v4
Iterable<BoxWebHook.Info> webhooks = BoxWebHook.all(api);
for (BoxWebHook.Info webhookInfo: webhooks) {
    // Do something with the webhook.
}
Python v3
webhooks = client.get_webhooks()
for webhook in webhooks:
    print(f'The webhook ID is {webhook.id} and the address is {webhook.address}')
.NET v5
BoxCollectionMarkerBased<BoxWebhook> webhooks = await client.WebhooksManager.GetWebhooksAsync();
Node v3
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 }
		*/
	});

This endpoint requires the application to have the Manage Webhooks scope enabled.

This API call will only list the webhooks for the authenticated user, not for any other users in the enterprise.

Лучший частный хостинг