Skip to main content
Question

Batch API calls?

  • May 21, 2025
  • 5 replies
  • 62 views

Forum|alt.badge.img

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.

5 replies

Forum|alt.badge.img

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.


Forum|alt.badge.img

It seems like it could be so easily solved! Just add some batch front ends to their backend code.

 

I'm building a report, and the number of individual API calls are rediculous.


Forum|alt.badge.img

Is this still the case?  It would be very helpful if we could make several calls at once.


Forum|alt.badge.img

Yes. It seems it is still the case. I have a report that is likely to run successfully the next time because it's going to bump into the daily allowed limit of API calls.


Forum|alt.badge.img

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