cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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

Re: Migrating access token from API v1 to v2

Greg-DB
Dropboxer

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?