We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
gilbertwulff
9 years agoExplorer | Level 3
So what is the use of a folder id?
I've been looking at ways to determine if a folder still exist on a dropbox account. I've noticed that there is two different ids being returned. One being just "id" and the other being "sharedFolder...
- 9 years ago
The 'id' can be used with various endpoints, in place of the file path. In many cases, you can just pass in the 'id' string in the 'path' parameter. For example, you can pass the 'id' as the 'path' value when calling /2/files/get_metadata. That's an easy way to check if a file or folder exists.
The /2/sharing/get_folder_metadata endpoint only operates on shared folders though, so it does require a shared folder ID, not just an 'id'.
You can get the shared folder ID directly from the FolderMetadata object though, e.g., as returned by /2/files/get_metadata or /2/files/list_folder[/continue]. That's included as sharing_info.shared_folder_id in the FolderMetadata object.
Greg-DB
Dropbox Community Moderator
9 years agoThe 'id' can be used with various endpoints, in place of the file path. In many cases, you can just pass in the 'id' string in the 'path' parameter. For example, you can pass the 'id' as the 'path' value when calling /2/files/get_metadata. That's an easy way to check if a file or folder exists.
The /2/sharing/get_folder_metadata endpoint only operates on shared folders though, so it does require a shared folder ID, not just an 'id'.
You can get the shared folder ID directly from the FolderMetadata object though, e.g., as returned by /2/files/get_metadata or /2/files/list_folder[/continue]. That's included as sharing_info.shared_folder_id in the FolderMetadata object.
- UserAccount4 years agoNew member | Level 2
I have just tried as you stated, pass the id in the path param. But unfortunately the request fails, with a message that the path has not been found?
Is this changed now and no longer supported?
Response sample:{"error_summary": "path/not_found/...", "error": {".tag": "path", "path": {".tag": "not_found"}}}
- Здравко4 years agoLegendary | Level 20
Hi UserAccount,
Are you sure you have tried with real folder id (as received from corresponding API call) and not some malformed path? 🤔
- Greg-DB4 years ago
Dropbox Community Moderator
UserAccount The API still supports these IDs. As Здравко mentioned, make sure you're using the correct value, e.g., as returned by the API itself. Also make sure you're calling using an access token that has access to the item, and that you're using the correct root, if applicable. etc. I recommend reading the File Access Guide and Team Files Guide for more information on interacting with files and folders via the API.
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!