Discuss Dropbox Developer & API
Hi,
I'm using DropBox API v2 to get folders and files from user account. For that I'm using "files/list_folder", "files/list_folder/continue" endpoints and also I'm using recursive: true for root folder and cursor: cursorvalue while iterate. The problem here is the user account contains almost 400k+ files and while downloading them I'm getting "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." error after some time. Is this error related to any API limitations? Is there any chance to get this error when multiple colletions running at same time?
Thanks,
OTKY
I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:
Thanks for the quick response . I'm not using any sdk just I'm using c# HttpWebRequest with API endpoints.
Find the below endpoints and breif description of the code .
endpoint : https://api.dropbox.com/2/files/list_folder
and adding {"path":"","recursive":true} to request stream
headers: Dropbox-API-Select-User:{{userId}}
if response contains "has_more" then using the below endpoint
endpoint : https://api.dropbox.com/2/files/list_folder/continue
{cursor:cursorid} to request stream
headers: Dropbox-API-Select-User:{{userId}}
to download files I'm using
endpoint: https://api-content.dropbox.com/2/files/download
{"path":"rev:{revisionId}"}
Regarding the error messages after running for sometime(more than 1 day) I got "Unable to connect to the remote server , A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" sometimes and "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server." sometimes.
Thanks,
OTKY
Thanks for following up. It's not clear from this why this would be happening, but a few possibilities/other questions:
Hi,
Please find my answers in Italic.
I'm not sure about these. But do these things cause the issue for accounts which have larger number of files?
Yes the overall process for downloading the files one by one from DropBox account.
Sometimes its failing at "/2/files/download" and sometimes its failing at "files/list_folder/continue" . But in both the cases its not failing immediately.
Yes , 2-3 processes running simultaneously .Is there any chances of throttling here ? If there is a throttling issue , will all the processes running at that time will throw errors and stop execution from then?
Thanks,
OTKY.
Things potentially interfering with your network connection wouldn't depend on how many files are in the connected account. I recommend checking for any such potential issues regardless of the file count.
For reference, the Dropbox API does have a rate limiting system, but if it rejects any particular call, it would respond with an explicit error response, with a 429 status code. It would not just close the connection as you're seeing here, so that does not seem to be the issue. In any case, 2-3 simultaneous requests is not excessive and so we would not expect such activity to be rate limited.
Also, since this is actually happening on both /2/files/download and /2/files/list_folder/continue (which use different hosts), it sounds like there's likely client-side issue here. We can't offer help with HttpWebRequest itself though, as that's not made by Dropbox.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!