Batch API calls?
回答済みGreetings,
I'm figuring out how to build a web app on top of box and in the course of this I'm noticing that a single query of the database would require several API calls. Say you are querying a box collection on keyword or with a mdfilter and you wanted to see a thumbnail for each result and some metadata to go with each. It's my understanding that you would have to make the initial search call and then for each result, you would need to make a separate call for each ones' metadata and each one's thumbnail. So if you retrieved10 results, this would be 21 calls for a single query. I may be missing a special parameter for the search endpoint that returns metadata?
I think the constraints can be architected around. No biggie, but am wondering if there's a more efficient way to do this? I did notice that the Facebook API allows you to "batch" calls. I think this would be most useful for my situation but haven't seen anything in the documentation about this kind of functionality in box.
https://developers.facebook.com/docs/graph-api/making-multiple-requests
Is this a capability that the Box API has? I figured it was worth asking before building my own way of doing this. Thanks for your help and your time.
-
Hi Although definitely beneficial and more efficient, the Box API does not currently support Batch API calls. If that should change in the future, you can monitor our API Changelog for updates.
-
Batchable calls have been added to some SDKs at the time of writing this.
For a node.js example see changelog for version 1.8.0: https://github.com/box/box-node-sdk/blob/master/CHANGELOG.md#180
And the documentation (which currently leaves something to be desired as it doesn't mention the 20 calls per batch cap among other things) can be found here: https://github.com/box/box-node-sdk/blob/master/docs/client.md#batch-api
サインインしてコメントを残してください。
コメント
5件のコメント