Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi there,
I am having a lot of trouble getting the contents of shared folders and the content of folders within shared folders.
Firstly, for the shared folder, according to the API I should be able to use https://api.dropboxapi.com/2/files/list_folder with "path": "id:{shared folder id}", however this returned a `path not found`.
So I had to get the preview url in the metadata of the shared folder, then use https://api.dropboxapi.com/2/files/list_folder with "path": "" and "shared_link":{"url": "{shared link}" I thought this was a bit of an unusual workaround.
Now for each file in the shared folder I can't access those using https://api.dropboxapi.com/2/files/list_folder with their ids, and they don't have shared links.
My questions:
a) Is it possible to access shared folder content via the Dropbox API?
b) If I can do this with a path, what is the path to shared folders? It's not relative to the root directory.
Hey Greg, this has been resolved.
When setting up a Dropbox API Key for `App Folder` or `Full Access`, you don't have access to the Shared folders until the user manually Adds the folder to their Dropbox account.
The account I was accessing had not done this. Issue resolved now. 🙂
Thank you very much for your patience and help in trying to get me through this!
Yes, you can list the contents of shared folders mounted in an account using the /2/files/list_folder[/continue] endpoints like any other folder. You have a few options for doing so:
It sounds like you're combining the last two, i.e., using the shared folder ID as a normal file/folder ID, which won't work. You can find some more information in the Namespace Guide.
To get the paths and IDs for any items in the account, you can start by calling /2/files/list_folder[/continue] for root, supplying the empty string "" as the 'path' parameter.
Can you tell me how to get a) the contents of a shared folder, and b) the contents of the folders inside a shared folder on a Dropbox Account (not a Dropbox for Business Account) via the HTTP API? The instructions you've given me are not working so is there a problem with my account?
The path to a shared folder would be the 'path_lower' value for the FolderMetadata object for the folder, e.g., as returned by /2/files/list_folder.
The id of a folder would be the 'id' value for the FolderMetadata object for the folder, e.g., as returned by /2/files/list_folder.
The shared folder ID would be the 'shared_folder_id' value for the FolderMetadata object for the folder, e.g., as returned by /2/files/list_folder.
These values should all be returned for the respective entries by /2/files/list_folder, e.g., when you list the root folder as I mentioned in my last post. (Note that if your team is using the "team space" configuration, and you're looking for folders in the team space itself, that will work slightly differently. You can find more information about that in the Namespace Guide. I don't have any particular reason to believe that's relevant in your case given your posts, but I'm mentioning it just in case.)
Anyway, if things don't seem to be working properly, please feel free to share some sample code and output, e.g., for the /2/files/list_folder call for root, etc., so we can take a look. (You can open an API ticket with the details if you want to share privately instead.)
Hi Greg,
Using /2/files/list_folder only works if I access this through the shared link of a shared folder, (shared_link parameter with url, path set to empty string), and I still can't get access to the folders within that shared folder using this because they don't have shared links.
The lower_path of the shared folder does not display when I retrieve metadata with files/list_folder, nor with sharing/get_folder_metadata, so I cannot access the shared folders via path, can you tell me if there is a default path for shared folders relative to the root?
I notice both shared folders that I want to access have "is_inside_team_folder": true.
If shared folders are within team folders, does this mean that I cannot access them unless I have a Dropbox Business API app key?
Hey Greg, this has been resolved.
When setting up a Dropbox API Key for `App Folder` or `Full Access`, you don't have access to the Shared folders until the user manually Adds the folder to their Dropbox account.
The account I was accessing had not done this. Issue resolved now. 🙂
Thank you very much for your patience and help in trying to get me through this!
Finally got this work after an hour. Dropbox API has extremely poor documentation.
Hey @havetoregister @Greg-DB ,
"Add to Dropbox" works for folders but any idea about shared files ?
Cuz they don't have this feature and while long polling or webhooks, Dropbox doesnt give the details of the file which was shared to the user.
@apo1397 "Shared folders" and "shared files" work a bit differently unfortunately. You can't add or "mount" a shared file in an account like you can with a shared folder.
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!