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
kennyli_floqast
3 months agoExplorer | Level 3
How do i get the relative path for a folder?
My app is integrated with dropbox. However, I see some changes coming for business team dropbox: https://help.dropbox.com/plans/upcoming-business-team-changes?_camp=16203&_tk=banner_campaign_format#...
Greg-DB
Dropbox Staff
Apps using the Dropbox API should continue using the same API methods/endpoints, such as filesListFolder and filesListFolderContinue, and the same properties such as path_lower or path_display, however you may need to make some changes, such as to start using the “Dropbox-API-Path-Root” header to make sure you're accessing the desired content. For instance, using the “Dropbox-API-Path-Root” header is necessary in order to access the contents of a team space.
Please read the following resources for information on how to use the API to interact with a team space:
kennyli_floqast
3 months agoExplorer | Level 3
Thanks! My code originally worked with team space but seems like they're rolling out changes. Not sure whats wrong with my existing code (I am already setting path-root). Does it have to be empty?
/**
* @param {Authorization} authorization
*/
function createDropboxInstance(authorization) {
const dropboxOptions = {
accessToken: authorization.access_token,
};
if (authorization.rootNamespaceId) {
Object.assign(dropboxOptions, {
pathRoot: JSON.stringify({
'.tag': 'root',
root: `${authorization.rootNamespaceId}`,
}),
});
}
return new DropboxSDK.Dropbox(dropboxOptions);
}
async fetchFilesAndFolders(storage, authorization) {
const dropboxSDKInstance = createDropboxInstance(authorization);
const folderMetadata = await this._folderInfoInternal(
storage,
authorization
);
return new Promise((resolve, reject) => {
const retryCallback = makeRetryCallback(resolve, reject);
retry(
Dropbox.retryOptions,
(callback) => {
dropboxSDKInstance
// @ts-ignore
.filesListFolder({ path: folderMetadata.path_display })
.then((response) => callback(null, response))
.catch((error) => {
this._logger.error(
formatLoggerErrors(
error,
'fetchFilesAndFolders'
)
);
this._logger.error(error);
callback(
StorageProviderError(
this.name,
error.status ? error.status : 500,
1005,
error.error
)
);
});
},
retryCallback,
this._logger
);
});
}
- Greg-DB3 months agoDropbox Staff
There are a number of ways to use the functionality, depending on what you're trying to do, but the pathRoot field, if being used, should not be empty. In order to access the team space, for instance, you should use the root mode and use the root namespace ID for the connected account.
To clarify, is something in particular currently not working as expected? Please feel free to share the specific error/unexpected output and I'll be happy to take a look.
Note that if you need a test team, you can request one using the process described under the "How do I test my application?" question here. Be sure to indicate what specifically you need to test.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months 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!