How do I set headers in the request?
Like Dropbox-API-Path-Root for createFolderv2?
The API v2 JavaScript SDK doesn't yet support the Dropbox-API-Path-Root header unfortunately, but I'll pass this along as a request to implement that.
For Dropbox-API-Path-Root see #230
The "Dropbox-API-Path-Root" functionality is now available in the JavaScript SDK, as of v4.0.15. You can set it using the pathRoot parameter for the Dropbox constructor:
var dbx = new Dropbox.Dropbox({
accessToken: '<ACCESS_TOKEN>',
pathRoot: JSON.stringify({".tag": "root", "root": "123456789"})
});
Please refer to the Namespace Guide for more information on using this feature.
Hello @ greg-db, I'm trying to use the root path with using DropboxTeam and it seems that the header is not set.
My sdk version is 4.0.28.
And i'm trying this:
const dbxTeam = new DropboxTeam( { accessToken: token, pathRoot: JSON.stringify( { '.tag': 'root', 'root': '5922959040' } ) } );
@sephh I see you also opened a PR, so I'll follow up with you there: https://github.com/dropbox/dropbox-sdk-js/pull/246