cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
In need of some #MondayMotivation? Read more

converting form API1 to API 2 on Power Query

86 Views
4 Comments
0 Kudos
Highlighted
Level 4

converting form API1 to API 2 on Power Query

I have been using API1 to pull individual files inot Excel Power Query using the syntax below. Can anyone help with correct syntax under API2 please?  My whole company reporting collapsed overnight. Thisiis my old path

 

https://api-content.dropbox.com/1/files/auto/DataModel/SourceFiles/Dates.xlsx?access_token=<ACCESS_T...

 

DataModel is a folder at the top of dropbox not an App folder as you can't share those.

 

Really appreciate any help as not a developer so don't understand the detial of the code

 

Mike

4 Replies
Dropboxer

Re: converting form API1 to API 2 on Power Query

Hi Mike, it looks like you were using the API v1 /files endpoint to download the file content. In API v2, the replacement is /files/download.

 

The standard way of using that endpoint is via a POST with 'Authorization' and 'Dropbox-API-Arg' headers, as shown in the example in the documentation in the "Request and response formats" section.

 

If you need to be able to just make a GET to it instead though, that is also supported by using the URL parameters documented 

 

So, using the example you posted, that would look like:

 

https://content.dropboxapi.com/2/files/download?authorization=Bearer%20ACCESS_TOKEN_HERE&arg=%7B%22path%22%3A%22%2FDataModel%2FSourceFiles%2FDates.xlsx%22%7D

Replace ACCESS_TOKEN_HERE with your access token.

 

By the way, I redacted it from your post, but since you initially posted your access token, for the sake of security, you should disable that access token. You can do so by revoking access to the app entirely, if the access token is for your account on the account security pageOr, you can disable just this access token using the API. You would need to then get a new access token and plug that in to your app instead.

 

By the way, if you need more time to migrate your app to API v2, we can offer an extension for access to API v1. To request that, please open an API ticket with the relevant app key(s).

 

Level 4

Re: converting form API1 to API 2 on Power Query

That was a bit stupid of me. So do I just delete the app by going to conencted app and then remove the linked app? Then recreate it?

 

Thanks

 

Mike

Dropboxer

Re: converting form API1 to API 2 on Power Query

Hi Mike, you don't need to delete/recreate the app itself. You can just unlink the app here using the 'x' for the app:

https://www.dropbox.com/account/connected_apps

That will revoke all of the access tokens for that app on your account. You can then get a new access token for that app on your account, by relinking the app to your account the same way you did originally.
Level 4

Re: converting form API1 to API 2 on Power Query

got it thanks