cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: converting form API1 to API 2 on Power Query

converting form API1 to API 2 on Power Query

masplin
Explorer | Level 4

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 4

Greg-DB
Dropbox Staff

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).

 

masplin
Explorer | Level 4

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

Greg-DB
Dropbox Staff
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.

masplin
Explorer | Level 4

got it thanks

Need more support?