cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you know more about files sizes, you can make more informed decisions about which files you upload and then you can maximize the space in your Dropbox Basic account?

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: 

generate code by using curl dropbox api

generate code by using curl dropbox api

aalok
Explorer | Level 4

I don't want user interaction to click and allow a button to get code. I want to get it through curl or api.

4 Replies 4

Re: generate code by using curl dropbox api

Greg-DB
Dropboxer

It is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.

 

You can find more information on this in the OAuth Guide and authorization documentation.

Re: generate code by using curl dropbox api

aalok
Explorer | Level 4

Any curl API to get refresh token and how to check whether access token expired or not.plz, send me an updated API document link.

Re: generate code by using curl dropbox api

Здравко
Super Collaborator | Level 20

Hi @aalok,

A minimalistic example of what you're asking for can be seen here. The example shows API access using CURL, but it's the same while using any other way/HTTP access method (HTTP client). Of course, once get familiar with the OAuth' idea, you can extend the example to use different authentication methods (PKCE, for instance) and improve automation (with a loopback port to get the code without copy/paste, using 'netcat' for example or similar). 😉

Hope this helps.

Re: generate code by using curl dropbox api

Greg-DB
Dropboxer

@aalok Yes, the links in my previous message as well as the link that Здравко shared show how to use the OAuth app authorization flow.

 

Attempting to use an expired short-lived access token will fail with the "expired_access_token" error. Refer to the Error documentation and Error Handling Guide for more information on handling errors.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Здравко Super Collaborator | Level 20
  • User avatar
    aalok Explorer | Level 4
What do Dropbox user levels mean?
Need more support?