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

get
https://api.box.com/2.0
/webhooks

リクエスト元のアプリケーションに対して定義されているすべてのWebhookを返します。

このAPIは、認証済みユーザーが所有するファイルまたはフォルダに適用されているWebhookのみを返します。つまり、管理者は、それらのフォルダにアクセスできない限り、サービスアカウントによって作成されたWebhookを表示することはできません。逆もまた同様です。

リクエスト

bearer [ACCESS_TOKEN]
application/json

クエリパラメータ

integer / int64クエリ内省略可能
10001000

返す項目の1ページあたりの最大数。

stringクエリ内省略可能
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii

結果が返される開始位置のマーカー。マーカーベースのページ割りを使用している場合に使用されます。

これを使用するには、usemarkertrueに設定する必要があります。

レスポンス

application/jsonWebhooks

Webhookのリストを返します。

アプリケーションにWebhookを管理する権限が付与されていない場合は、エラーを返します。

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

get
すべてのWebhookのリストを取得
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

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)
    }
}

レスポンスの例

{
  "entries": [
    {
      "id": "11446498",
      "type": "webhook",
      "target": {
        "id": "1231232",
        "type": "file"
      }
    }
  ],
  "limit": 1000,
  "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
  "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}