Forum Discussion
Dropbox API | How to specify Dropbox-API-Path-Root Header in Web.Contents call?
- 2 years ago
For someone having the same problem in the future, this is how I solved it, which was actually pretty close to the first try...
header = [ #"Authorization"="Bearer "&token, #"Content-Type"= "application/json", #"Dropbox-API-Path-Root" = Text.FromBinary(Json.FromValue([#".tag" = "root", root = "xxxxxxxxxx"]))] response = Web.Contents("https://api.dropboxapi.com/2/files/list_folder", [Content=Json.FromValue(data), Headers=header]),So, adding Text.FromBinary and Json.FromValue seems to let you be able to give a nested list in the header from the Web.Contents call, anyway in this case🥳.
your first version looks ok. Are you using something different from "/" as root?
- yhogebrug2 years agoFrequent Visitor
What do you actually mean with "using something different from '/' as root"?
I get the following error, which states that a value of type Record can't be converted to type Text:
I understand that it gives this error, because my list with header items looks like this:
How can I give a list with a record in it, so actually a list with another list in it, to my Web.Contents call?
Without the 'Dropbox-API-Path-Root' argument my code works, but it can only get the content from my personal space in Dropbox and not from my organization space. I'm quite sure that I can fix it with the 'Dropbox-API-Path-Root' argument.
Do you have any idea what I have to change to make it work?
- lbendlin2 years ago
Super User
As you can probably appreciate it is nearly impossible to help with API queries without access to said API (which you may not be willing to provide for understandable reasons)
- yhogebrug2 years agoFrequent Visitor
I understand and indeed I cannot provide that.
But one last question then, because I think that this could be a solution. Is it in general possible to give a nested list to the Web.Contents call in the header? Or is that dependent of the API you use in the Web.Contents call? Because I need to give a 'tag' and a 'root' argument for the argument of 'Dropbox-API-Path-Root'.