You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
havetoregister
7 years agoHelpful | Level 6
Get list of files in folders inside shared folders
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 shou...
- 7 years ago
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!
Greg-DB
7 years agoDropbox Staff
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:
- by full path in the 'path' parameter, e.g.: "/path/to/shared/folder"
- by folder ID in the 'path' parameter, e.g.: "id:abcd1234" (where 'id:abcd1234' is the 'id' for the folder)
- by shared folder ID as a namespace ID in the 'path' parameter, e.g.: "ns:12345678" (where '12345678' is a shared folder ID)
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.
- havetoregister7 years agoHelpful | Level 6
- "by full path in the 'path' parameter, e.g.: "/path/to/shared/folder""
- What is the path to a shared folder relative to the root? I can't get this information in the shared folder metadata. You stated I could get the paths and IDs for any items in the account by "calling /2/files/list_folder[/continue] for root, supplying the empty string "" as the 'path' parameter." but this doesn't display shared folders.
- "by folder ID in the 'path' parameter, e.g.: "id:abcd1234" (where 'id:abcd1234' is the 'id' for the folder)"
- I've done this with the ids of folders inside shared folders and I get the "path/not_found/" error.
- "by shared folder ID as a namespace ID in the 'path' parameter, e.g.: "ns:12345678" (where '12345678' is a shared folder ID)"
- I've done this with the shared_folder_id and I get the "path/not_found/" error
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?
- Greg-DB7 years agoDropbox Staff
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.)
- havetoregister7 years agoHelpful | Level 6
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?
- "by full path in the 'path' parameter, e.g.: "/path/to/shared/folder""
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 17 hours agoIf 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 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!