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

Forum Discussion

TwinBlade's avatar
TwinBlade
Helpful | Level 5
7 years ago

Create Folder on a shared space doesn't have a have shared folder Id

Hey,

I am using the .NET SDK and I found something odd  that I wanted to share.

I am using CreateFolderV2Async to create a folder on the root namespace and then I would like to save its namespace id/shared folder id, but if I use it like this: 

var result = await dbc.Files.CreateFolderV2Async("name");

and then get the shared folder id from the result like this: 

result.Metadata.AsFolder.SharedFolderId;

It is null. I have to do a seperate request to get the ID.

Wondering if this is a design decision or just something unplanned.

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    This is the expected behavior. The CreateFolderV2Async method creates a standard folder (private by default, unless it happens to be created inside some other shared folder), not a shared folder.

    If you intended to share an existing folder, or make a new shared folder, you should use ShareFolderAsync instead. 

    Or, to get the shared folder ID of the shared folder above the newly created folder, if any, you should check the ParentSharedFolderId instead of SharedFolderId.

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!