Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
MapTiler
9 years agoExplorer | Level 3
API rate limit error
Hi all, I'm using SwiftyDropbox in a Swift 3 app. I managed to get authentication working, I can get the details of the authenticated user, I can upload files, I can download files, I can create ...
MapTiler
9 years agoExplorer | Level 3
Hi Greg,
You have all the information you need to know to reproduce the problem:
- SwiftyDropbox
- loop a couple of 100 times over your createFolder call
- log the errors from the response callback (response part will be nil, error part will be filled with the error)
- Again, the error = API RATE LIMIT ERROR with a retry_after = 1 in the json reply
That's it.
Storing files is your business, yes? Your API apparently won't let me do that without errors. Asking for source code for something that should be working out of the box in the firstplace is getting downright annoying.
You *know* how to simulate it because I've told you ... twice.
Right now the customer is considering moving away completely from Dropbox. So are we going to get a reply from you or do we move away?
Greg-DB
Dropbox Community Moderator
9 years agoThanks for following up. There are multiple different rate limit errors you might get, so I asked for the specific error so that I can make sure I offer the right information.
Specifically, with SwiftyDropbox, a RateLimitError will have a RateLimitReason which can be either tooManyRequests or tooManyWriteOperations.
For 100 calls, I wouldn't expect you to be getting tooManyRequests, but if you are, please let me know as that would likely be a bug. (I did try simulating this by making 100 create folder calls in a loop, but I didn't run in to any errors.)
More likely, I suspect you're getting tooManyWriteOperations. This isn't an imposed rate limit exactly, but rather a technical inability to make multiple modifications at the same time. This is "lock contention", and you can find more information on it in the data ingress guide. The simultaneous activity can be coming from your own app, or from any other source on the user's account, such as other API apps, the official clients, etc.
The way to handle this is the same though. Your app should just retry after the specified Retry-After time.
One optimization you may be able to make however, is to forgo the create folder calls entirely. If you're uploading files to paths where the parent folders don't already exist, you don't need to make the create folder calls. You can just send the upload calls and the parent folders will be automatically created.
Hope this helps!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!