We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

MariosChr81290's avatar
MariosChr81290
Explorer | Level 3
8 years ago

Migrating access token from API v1 to v2

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 2 days ago
411 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!