Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
There has been an update in Dropbox and also in the API a couple of weeks ago. It is now necessary to specify the root to get your documents from Dropbox. I came along this newsitem where they explain how to implement this. The following is explained in that newsitem:
How can I implement this in my Power BI code? It was working before, but now it seems that I have to extent the header. The problem here is that I have to give a nested list in the parameter 'Dropbox-API-Path-Root' I think. I tried a couple of things, like:
header = [ #"Authorization"="Bearer "&token,
#"Content-Type"= "application/json",
#"Dropbox-API-Path-Root" = [#".tag" = "root", root = "xxxxxxxxxx"]]
response = Web.Contents("https://api.dropboxapi.com/2/files/list_folder", [Content=Json.FromValue(data), Headers=header]),
where the value for root is the root_namespace_id, but this gives me an error that a value from type Record can't be converted to type Text. And i tried:
header = [ #"Authorization"="Bearer "&token,
#"Content-Type"= "application/json",
#"Dropbox-API-Path-Root" = ".tag = 'root', root = 'xxxxxxxxxx'"]
response = Web.Contents("https://api.dropboxapi.com/2/files/list_folder", [Content=Json.FromValue(data), Headers=header]),
where I get a 400 Bad Request error.
Can someone explain me how I can specify the root when connecting to the Dropbox API?
Solved! Go to Solution.
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🥳.
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?
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?
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)
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'.
Usually payloads go into the request body, not the header.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.