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
JimmyMcnulty
3 months agoNew member | Level 2
Creating an integration for both Regular and Business users
I created a Dropbox app that allows users to upload files into my app. All was well until I realized, that users with Dropbox for Business can't import files, because I needed different scopes for th...
- 3 months ago
Yes, that's correct. Using the 'pathRoot' property sets the "Dropbox-API-Path-Root" header; if you use the "root" mode like that and set it to the account's root_namespace_id that would set the call to operate in the root for the account (such as the team space, if any).
Greg-DB
3 months agoDropbox Staff
JimmyMcnulty To confirm, Здравко is correct; you can and should use the same user scopes on a single app with the same files endpoints to work with files in both business and non-business accounts. You don't need team scopes to work with files in accounts that happen to be on business teams. For example, to upload files, you would use the same /2/files/upload endpoint which only requires the "files.content.write" user scope, whether or not the user is a on a team. (You would only need team scopes to perform operations on the team, such as to add/remove team members.)
One difference though is that by default, API calls to the Dropbox API operate in the "member folder" of the connected account, not the "team space". That means that by default, the contents of the team space will not be found and uploads will go to the member folder, not the team space. You can configure API calls to operate in the "team space" instead though, in order to interact with files/folders in the team space. To do so, you'll need to set the "Dropbox-API-Path-Root" header, but you can still do so without team scopes. You can find information on how to use this in the Team Files Guide.
- JimmyMcnulty3 months agoNew member | Level 2
Thanks for the reply Greg.
I think I managed to have a small breakthrough after your explanation:new Dropbox({accessToken,pathRoot: JSON.stringify({ ".tag": "root", root: "XXX" })});In this example, I'm assuming this will always work, as long as I passroot_namespace_id from /2/users/get_current_account, is that correct?- Greg-DB3 months agoDropbox Staff
Yes, that's correct. Using the 'pathRoot' property sets the "Dropbox-API-Path-Root" header; if you use the "root" mode like that and set it to the account's root_namespace_id that would set the call to operate in the root for the account (such as the team space, if any).
- Здравко3 months agoLegendary | Level 20
JimmyMcnulty wrote:... I passroot_namespace_id from /2/users/get_current_account, is that correct?In general yes, but better check if the root namespace is different that home namespace and use the above only when they are different. In such a way your code becomes universal - will work everywhere on any account. 😉
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 2 days 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!