Forum Discussion
Dropbox API v2, gateway credential error
- Anonymous9 years ago
Below is the correct answer using API v1 and OAUTH1 from user Masplin (Mike), not me.
But I tried this and it worked perfectly!
I have successful connected my desktop model to an anonnymous dropbox link and it refreshes absolutely fine on PBI servce. OneDrive is an absolute disaster as a cloud storage system, it works for Power bI but is garbagge for anything else.
The issue I have is where my query is doing a folder query so I need ot try Imke solution
For example I have this file Inputs.xlsx which sits in Dropbox\DataModels\SourceFiles.
firstly create a blank query to set the path to the file
DropboxSourcePath is
let
Source = "https://api-content.dropbox.com/1/files/auto/DataModel/SourceFiles/"
in
SourceSecondly go onto dropbox online and into developer section as Imke described ot create an app and get a token. In my case I have tried her folder app so I just got a token for the whole of dropbox.
Token is
let
Source = "?access_token=lkPfa4vOd-AAAAAAAAAAKjmGh93HWPeYFfffdfffdfdggf-CY0LSTVss5JF53HOGK46xxkWsQzhj-"
in
SourceThen your query becomes. Note now web.contents instead of file.contents and if you have any path its "/" not "\"
let
Source = Excel.Workbook(Web.Contents(DropboxSourcePath & "Inputs.xlsx" & Token), null, true),
Seasonality_Table = Source{[Item="Seasonality",Kind="Table"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Seasonality_Table,{{"Month No", Int64.Type}, {"Month", type text}, {"Car Count Seasonality", type number}, {"GTV Seasonality", type number}})
in
#"Changed Type"So I can refresh all conenctions on desktop and when I publish to PBI Service I see under credential web for each of these dropbox links. Edit conenction and chose annonymous.
I reached dropbox support, and the guy explained something that is really confusing:
API v1 is no longer available.
API v2 is the only option today.
Authentication OAUTH1 and OAUTH2 are both still working, and there is no relation between API version or OAUTH version.
It is possible to use APIv2 using OAUTH1, and now I need to update my code from the previous post...
FYI, Anonymous has the solution in the thread below. I have also attached a screenshot of my advanced query editor window with the fix in place (I ONLY edited the single line of code highlighted in blue in all of my queries to get them working again with v2).
- Anonymous8 years agoNot applicable
the solution code (below) from the other post works only on PBI Desktop.
once it is published, it gets credential error on PBI Service.
is there any workaround to make it work and refresh on PBI Service?
let
Source = Excel.Workbook(Web.Contents("https://content.dropboxapi.com/2/files/download", [Headers=[Authorization="Bearer mytoken", #"Dropbox-API-Arg"="{""path"": ""/myfolder/myfile.xlsx""}"]]), null, true)
in
#"Source"- leewsimpson8 years agoFrequent Visitor
Anyone found a solution to this?
- hugoventurini8 years agoAdvocate IV
I have this same problem, and I am looking for a solution; I also used the function proposed by Imke Feldman and it worked perfectly in Power BI Desktop, however, I can not authenticate the source to schedule automatic updating.
If another function is required to allow authentication, I don't understand where this function should be inserted.
- Anonymous8 years agoNot applicable
I opened a support ticket 5 months ago, still no solution. Every month they send my issue to another engineer, but no one helped so far. and sincerely, and I think they never will, as dropbox is rival to onedrive... sad.