cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in learning how media industry leaders use Dropbox Replay? Register for our webinar here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there any API limits

Is there any API limits

prachi s.1
New member | Level 1

Hi,

I am working on developing an integration, would like to understand what are the API limits for Dropbox APIs v2 per day per user?

10 Replies 10

Greg-DB
Dropbox Staff

The Dropbox API does have a rate limiting system, but we don't have any specific numbers documented. It is only designed to prevent abuse though, and is accordingly very generous. Further, the limits operate on a per-user basis. That being the case, you generally don't need to worry about hitting it in normal use.

Also note that not all 503s indicate rate limiting, but in any case that you get a 429 or 503 the best practice is to retry the request, respecting the Retry-After header if given in the response, or using an exponential back-off, if not.

Mark L.45
Collaborator | Level 8

I am testing a dropbox app I have written and I running into limits it seems, although I not getting any errors, simply dead space. I am creating links to files so that I can share them, more than a hundred links @ a time? I am using the HTTP interface to do so with the call...

https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings

I can of course limit this or issue warning if I can get some sort of response? How can I monitor this more effectively?

Greg-DB
Dropbox Staff

Mark, can you clarify what you mean when you say you don't get any error, but "simply dead space"? Any rate limiting from the Dropbox API would return an explicit error. It may be helpful if you share your code and output.

Mark L.45
Collaborator | Level 8

Hi Greg.

By dead space I mean the app appears to simply hang; it isn't hanging its waiting for dropbox to reply to all of its requests, replies that never it seems come back.  That said it does work, if I re-run the app, just moments later it retries the requests, and gets the response that the links already exist.

So the limit that is coming up seems to be linked to the number of links i request and get an almost immediate response too. It not an app killer as limitations go, I don't really see the problem unless I request 450+ links over a few seconds, but I am little worried since I don't know what is happening and if I do manage to get app live on the apps store I don't want to watch it go up in smoke as it becomes more successful and fires off more and more requests for links that get silently throttled on the dropbox end.

It would be better if I could monitor/throttle my app/give the user some feedback as oppose to guessing what the limits are.

Greg-DB
Dropbox Staff

If the connection hangs, that sounds more like network issues, rather than rate limiting from our side. (E.g., if you're making many call at the same time, your connection may be getting congested.) 

Any actual rate limiting from Dropbox would return a response with a 429 or 503 status code, sometimes with a Retry-After header.

Mark L.45
Collaborator | Level 8

Greg, 

Here the code for good measure, I try and setup some reporting from the errors here. I though I was watching it, but looking at this perhaps not. It is a swift function.

func createSharedLink(lePath:String, completion: (string: String?, error: ErrorType?) -> Void) {        

        let request = NSMutableURLRequest(URL: NSURL(string: "https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings")!)

        let session = NSURLSession.sharedSession()

        request.HTTPMethod = "POST"

        

        request.addValue("application/json",forHTTPHeaderField: "Content-Type")

        request.addValue("path", forHTTPHeaderField: lePath)

        request.addValue("short_url", forHTTPHeaderField: "false")

        request.addValue("settings", forHTTPHeaderField: "requested_visibility\": \"public\"}")

        let nodeA:NSMutableDictionary? = ["path":lePath]

        do {

            let jsonData = try NSJSONSerialization.dataWithJSONObject(nodeA!, options: [])

            request.HTTPBody = jsonData

                } catch {

            completion(string: ", error: error)

        }

        let task = session.dataTaskWithRequest(request, completionHandler: {data, response, error -> Void in

            if let error = error {

                completion(string: ", error: error)

                return

            }

 })

        task.resume()

 

Mark L.45
Collaborator | Level 8

Greg,

Here is an error message.

operation2 completion 609 744 ticktok 102

error  Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x14ea8ec70 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings, NSErrorFailingURLKey=https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}

So I ask for a shared link and NSURLSession.sharedSession() gives up waiting for a reply? This was at 609 links. I think these all existed, I simply sending a create to check at this point. If I actually create links the error must be happening sooner.  Sorry, I think your right, this looks like Swift/Network issue...

Greg-DB
Dropbox Staff

Yes, that looks like what's happening. That is, the connection took too long and timed out. That can certainly happen if you try to make too many at the same time, so you'll probably just want to put a limit on how many you do simultaneously. 

Mark L.45
Collaborator | Level 8

Yes; I checked and changed this line of code; which fixed it. Its not a good fix; I need to throttle the requests; but that I needs more coding and its been a long day 🙂

let url = NSURL(string:"https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings")

        let request = NSMutableURLRequest(URL: url! ,cachePolicy: .ReloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 120.0)

The default timeout I find out is 60 seconds, I doubled it 🙂

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Jorina New member | Level 1
  • User avatar
    Mark L.45 Collaborator | Level 8
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?