Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
JimmyMcnulty
2 years 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...
- 2 years 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
Dropbox Community Moderator
2 years agoJimmyMcnulty 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.
JimmyMcnulty
2 years 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 pass
root_namespace_id from /2/users/get_current_account, is that correct?
- Здравко2 years 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. 😉
- Greg-DB2 years ago
Dropbox Community Moderator
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).
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!