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: 

Migrating access token from API v1 to v2

Migrating access token from API v1 to v2

MariosChr81290
Explorer | Level 3

Hello,

 

I am trying to migrate our API to version 2 and followed the migration guide with no success(https://www.dropbox.com/developers/reference/migration-guide ).

 

Just one example is that I am using the link below in order to connect my excel spreadsheet with our BI tool using the api v.1 and access token.

 

https://api-content.dropbox.com/1/files/auto/bbbb/aaa.xlsx?access_token=FJCKHGCGFCsWSwSsSAwSsSGssSSg...

 

Can you please help me to migrate this example to api version2 and use this example to migrate the rest of the links?

 

Many thanks and I am looking forward for your response.

1 Reply 1

Greg-DB
Dropbox Staff

In that example, you're using /1/files to access file data. In API v2, the replacement is /2/files/download:

https://www.dropbox.com/developers/documentation/http/documentation#files-download

That's a "content-download endpoint", so the standard way of using that is via a POST with 'Authorization' and 'Dropbox-API-Arg' headers. To just use a GET with it instead though, i.e., so you can just use a URL by itself, you can use the URL parameters documented here:

https://www.dropbox.com/developers/documentation/http/documentation#formats

So, to access a file at "/bbbb/aaa.xlsx" the API call parameters for /2/files/download would be:

 

{"path": "/bbbb/aaa.xlsx"}

URL encoding those for use with the `arg` URL parameter, along with the 'authorization' URL parameter, the result would be:

https://content.dropboxapi.com/2/files/download?authorization=Bearer%20ACCESS_TOKEN&arg=%7B%22path%22%3A%20%22%2Fbbbb%2Faaa.xlsx%22%7D

Be sure to replace ACCESS_TOKEN with the actual access token.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?