Forum Discussion

yhogebrug's avatar
yhogebrug
Frequent Visitor
2 years ago
Solved

Dropbox API | How to specify Dropbox-API-Path-Root Header in Web.Contents call?

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 explai...
  • yhogebrug's avatar
    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🥳.