dropbox-sdk-js icon indicating copy to clipboard operation
dropbox-sdk-js copied to clipboard

How do I set headers in the request?

Open cggaurav opened this issue 8 years ago • 5 comments

Like Dropbox-API-Path-Root for createFolderv2?

cggaurav avatar Nov 29 '18 07:11 cggaurav

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.

greg-db avatar Nov 29 '18 14:11 greg-db

For Dropbox-API-Path-Root see #230

Bohdan-Tereta avatar Dec 16 '18 09:12 Bohdan-Tereta

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.

greg-db avatar Jan 07 '19 20:01 greg-db

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 avatar Jul 18 '19 11:07 sephh

@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

greg-db avatar Jul 18 '19 15:07 greg-db