cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more here.

Discuss Dropbox Developer & API

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

Re: Is it possible to automate getting the access code?

Is it possible to automate getting the access code?

Vineeth1
New member | Level 2


I tried using selenium to automate but I keep getting captcha which I cant get past it
Is there any way of getting past that

4 Replies 4

Здравко
Legendary | Level 20

@Vineeth1 wrote:

... I keep getting captcha ...


@Vineeth1, that's the reason of captcha to be there. 😀

If you want long term access, you can rely on refresh token instead of access token only. 😉

Vineeth1
New member | Level 2
curl https://api.dropbox.com/oauth2/token \
    -d code=AUTHORIZATIONCODEHERE \
    -d grant_type=authorization_code \
    -u APPKEYHERE:APPSECRETHERE​

I tried using this to getting refresh token using this. The json doesnt contain refresh code in it. Is there any settings I need to change

Здравко
Legendary | Level 20

@Vineeth1 wrote:

... The json doesnt contain refresh code in it. Is there any settings I need to change


Hi @Vineeth1,

Did you denote offline access in your authorization URL? 🧐 If I have to bet, No. 👈

Take a look on this example. You don't need the last step there, just get the refresh token.

Hope this helps.

DB-Des
Dropbox Engineer

@Vineeth1 

 

As Здравко mentioned, you'll need to make sure that token_access_type=offline is included in your request to /oauth2/authorize

https://www.dropbox.com/oauth2/authorize?client_id=<APP_KEY>&token_access_type=offline&response_type=code

 

Once that is successful, you should see a refresh_token in the response.

 

Feel free to reference our OAuth guide for details on refresh tokens.

Need more support?