Understanding API Rate-Limits
AnsweredHi All,
I am in the middle of implementing a one-time migration of files from one cloud based system to Box and to do so I am leveraging the Box 2.0 API, more specifically, the Preflight check. Upload File and Create Metadata on File post calls.
My question is as follows, I have a little over 28k files to migrate and I'm curious how to best ensure that in one run of my script I don't run into any rate limits.
I will definitely write back the resulting fileId's to files in my original locatino just so I can keep track of what has been successfully uploaded and what has not in the case that I run into a rate limit half-way through the migration.
But I'm curious as to what the right way to do something like this would be to avoid any limits (if there is such a way).
I didn't see any hard numbers around how many API calls you can make in any given period, which is the reason for the query.
Appreciate any advice and all who read.
Thanks.
-
I believe the rate limits are, in part, based on what level of service you have. The best way to get the actual numbers is to open a ticket. I've been given different answers depending on who, at Box, I speak with.
That said,they tend to recommend an exponential backoff approach, which I don't personally find to be very practical. What I can tell you is that the API limits are per user.
One of my applications is a headless bulk-loader that monitors for documents added to a filesystem and loads them into Box. It has a pool of 25 Box App Users to work from. If I get a 429 error (too many API calls), then I switch to a different App User and resubmit the request. That's gotten me around the problem without signficantly impacting performance.
-
Thanks SalsaShark42 this does help.
I think I'm going to try and ask about my limit as a support case. I'm hoping it's a set number and not something too compliated but I'll find out.
Thanks for the insight, gives me some idea at how I can handle a similar (albeit, one time) migration request on my end.
Please sign in to leave a comment.
Comments
2 comments