cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't Access Business Account Root Folders from Dropbox Client App

Can't Access Business Account Root Folders from Dropbox Client App

Faulk
Explorer | Level 4
Go to solution

Hello,

 

Our company has a business advanced account, with members managed through Azure AD. At the root are two folders: one for my account, "Faulk", and another intended to house externally managed documents, call it "Work".

 

Our intention is to manage the contents of Work externally through the API, uploading, downloading, and deleting files in a folder structure, authenticating using a Dropbox App rather than an Azure account.

 

I created an app in the App Console, gave it scope permissions (account_info.read, files.metadata.read, files.content.write, files.content.write, sharing.write, sharing.read), connected the app using oauth2/authorize including the client id and "token_access_type=offline&response_type=code". I then called oauth2/token, passing the code, and received an access token.

 

With this access token, files/list_folder only returns the contents of the Faulk folder.

Calling sharing/list_folders return Work, Faulk, and the contents of Faulk.

 

Adding the shared link for Work to files/list_folder returns the contents of Work, but doesn't include shared links or id's I can use to manage that content. Altering the "path" value didn't work either.

 

Other details: my account is an admin, I've tried adding Team scopes to the app with no success (using Dropbox-API-Select-User or Dropbox-API-Select-Admin produced the same results when calling files/list_folder), calling sharing/mount_folder for Work tells me "This shared folder has already been added."

 

My questions are:

Is it possible to view/manage files and folders within the parent business account using a Dropbox app in this manner?

Should the app have been created under a different account?

 

I feel like this issue is similar to this post: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Get-list-of-files-in-folders-inside-sha... but the solution in their case concerned sharing across different dropbox accounts, not accessing different folders within a parent business account.

 

Thanks very much for any help you can offer!

 

Edit: as an addendum the Faulk folder shows as a Shared folder type, while the Work folder shows as a Team folder type. Also, when using Dropbox-API-Select-Admin with any of the other admin's accounts files/list_folder returns no results (they do not have personal folders).

 

Edit2: complicating things possibly: prior to my company setting up the business account I had set up a personal account using my company email address. Once the business account was created, the personal account was merged into the business account, which is where the Faulk folder came from.

 

 

 

 

 

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hi @Faulk,

By default the point assumed to be root for API access is users home folder (i.e. your Faulk folder), not the account root. If you want to change this root to any other namespace (including to account root), you need to use Dropbox-API-Path-Root header. 😉

Hope this helps.

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

Hi @Faulk,

By default the point assumed to be root for API access is users home folder (i.e. your Faulk folder), not the account root. If you want to change this root to any other namespace (including to account root), you need to use Dropbox-API-Path-Root header. 😉

Hope this helps.

Greg-DB
Dropbox Staff
Go to solution

@Faulk Здравко is right; it sounds like you want to access the "team space". You can certainly do so from any account that has access to the team space, but by default, API calls operate in the "member folder" of the connected account, not the team space. You can configure API calls to operate in the team space instead though. To do so, you'll need to set the "Dropbox-API-Path-Root" header. You can find information on this in the Team Files Guide.

Faulk
Explorer | Level 4
Go to solution

You are 100% correct. Been beating my head against the wall for hours and it was that easy. For anyone coming across this, the corrective steps were:

 

  • Call users/get_current_account and grab the "root_namespace_id" value from the account result.
  • Add a Dropbox-API-Path-Root header with a value {".tag": "namespace_id", "namespace_id": "<that value>"} to the files/list_folder call.

From there you can adjust the path value as needed.

 

For those using the SDK, here's an example (.net):

 

using (DropboxClient client = new DropboxClient(<accessToken>).WithPathRoot(new Dropbox.Api.Common.PathRoot.NamespaceId(<root path id>)))
{

}

 

Thanks so much for your help and quick reply!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Faulk Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?