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: 

VBA & API authentication

VBA & API authentication

agomezv
Explorer | Level 3

Hi, I have a VBA  that uses the API to create  shared links (another process generates these files) , by now  I´m using the token that the AppConsole generates and everything it´s ok.

I only need to make this to files from one account ( my account) 

The token that I generate has limited time.

My question is: How can I get access the  API whitout implement the OAuth2 flow?

 

This because it will be impossible that the user gets a token from the AppConsole everytime that he use my VBA app.

 

Thanks in advance

4 Replies 4

Здравко
Legendary | Level 20

@agomezv wrote:

...

My question is: How can I get access the  API whitout implement the OAuth2 flow?

...


Hi @agomezv,

It's impossible yet.

 


@agomezv wrote:

...

This because it will be impossible that the user gets a token from the AppConsole everytime that he use my VBA app.

...


The user doesn't need to go in such a way. He can authenticate your application like any other app (like the example here in Python) or authentication in advance and using credentials further, in the actual application, without any other user actions within the app itself.

Hope this helps.

Greg-DB
Dropbox Staff

@agomezv It is not possible to get long-term access without using the OAuth app authorization flow. Apps can get long-term access by requesting "offline" access in the OAuth flow, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. Note that you only need to do this once per account though, as the resulting refresh token does not expire.

 

You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.

 

agomezv
Explorer | Level 3

Thanks Здравко and Greg, One more question:

If from a browser I invoke:

   https://www.dropbox.com/oauth2/authorize?client_id=fkdw14thym0pxgz&response_type=code&token_access_t... 
   to get an auth code, 

 

And then, within my VBA app, use the 

 

'curl https://api.dropbox.com/oauth2/token \
' -d code=<AUTHORIZATION_CODE> \
' -d grant_type=authorization_code \
' -d redirect_uri=<REDIRECT_URI> \
' -d client_id=<APP_KEY> \
' -d client_secret=<APP_SECRET>

 

Can I get and refresh the token? Does it will work ?

 

Thanks

Greg-DB
Dropbox Staff

@agomezv Yes, that process would give you a refresh token that can be stored and re-used repeatedly to get new short-lived access tokens as needed.

Need more support?