Forum Discussion
Connecting to data source hosted on Dropbox
@@JAkerblo, are you using api v1 or v2?
I cannot insert the list_folder code in the other web queries from the other posts.
Could you please send an example of your working code?
Sorry Anonymous! The example I used to implement this was a company production report. I'd have to make a test example, but I can do it with a little spare time today or tomorrow if you're still stuck.
It is api v2. My instructions tell you to get the access token via the API Explorer link on the home page of dropbox.com/developers. Ctrl+F your way to "list_folder" and click on Get Token and follow the instructions to get a token for what you need. In my situation I have both a personal account and a company one, so I have to choose before I can generate a token.
After that you have the query step in powerbi desktop. This line is all you need and then you can go on and navigate to the excel sheets you're interested in. Nothing else.
= Excel.Workbook(Web.Contents("https://api-content.dropbox.com/1/files/auto/<PATH FROM DROPBOX ROOT TO EXCEL OF INTEREST>/<EXCEL FILENAME>?access_token=<ACCESS TOKEN GENERATED FOR THE DROPBOX ROOT YOU'RE IN>"), null, true)"So in context, my M code looks like:
let
Source = Excel.Workbook(Web.Contents("https://api-content.dropbox.com/1/files/auto/<PATH FROM DROPBOX ROOT TO EXCEL OF INTEREST>/<EXCEL FILENAME>?access_token=<ACCESS TOKEN GENERATED FOR THE DROPBOX ROOT YOU'RE IN>"), null, true),
Assignments_Sheet = Source{[Item="Assignments",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Assignments_Sheet, [PromoteAllScalars=true]),
and so on...
- Anonymous9 years agoNot applicable
JAkerblom, I really apreciate if you could test the list_folder command for me.
once I can connect to Dropbox using my token and view all files, I can handle them myself. but first I need to connect to the files and view them inside PBI query editor.
using web query or M language, I am having issue to make it work with my token and the supposed-to-be link below.
https://api.dropboxapi.com/2/files/list_folder
as I learned in Dropbox,
API v1 is: api-content.dropbox.com/1/etc
API v2 is: api.dropboxapi.com/2/etc
This is why I believe your code is using the old v1 API.
https://www.dropbox.com/developers/reference/migration-guide
- JAkerblom9 years agoFrequent Visitor
Follow these images below.
And second, you're not supposed to use that link as you implied. Use the one I mentioned, and use it the way I described and all will be alright.
https://api-content.dropbox.com/1/files/auto/<Path to file>?access_token=<token>
- Anonymous9 years agoNot applicable
yes, I followed these steps correctly, but this link only works when a file name is provided.
I created a new token for the new command list_folder.
I don´t want to load a single file, I need to load the contents of a folder, and view all files inside the folder.
I tried many times, many different codes. I got a lot of errors each test: 400, 404 and 405.
And so far nothing is loaded.