Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

mnmtm's avatar
mnmtm
New member | Level 2
9 years ago

Get parent folder of a shared folder

I am using "list_folder" to get the details of a sub-folder. I want to find the ID of its parent folder. But  "parent_shared_folder_id" contains the ID of its grand-parent folder, not its immediate parent folder. Is there a way to get an item's immediate parent ID?

 

 

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    The parent_shared_folder_id field will contain the shared folder ID for the shared folder that contains the item, regardless of how many levels up that is.

    If you want the immediate parent of an item, whether or not it is the shared folder itself, you can strip the last element off of the item's path_lower.

    Using that path, you can call /files/get_metadata or /files/list_folder as necessary to get the metadata you want.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!