cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

getting Token with VBA

getting Token with VBA

Riccardo Chojwa
Explorer | Level 4
Go to solution

Hi

is there a way to get the DropBox token programmatically through VBA (or a different language, I'll try and translate it into VBA)?

this to have my VBA macro go on after that and download a file thorugh DropBox API for which I need the token for the "bearer" parameter

Thanks

Riccardo
Riccardo

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

I'm not sure exactly what you were trying to build with that code, but no, you should not be attempting to programmatically access the Dropbox web site like that.

View solution in original post

4 Replies 4

Riccardo Chojwa
Explorer | Level 4
Go to solution

Hi

I'm trying to login to my DropBox account through the following code

Dim myURL As String
myURL = "https://www.dropbox.com/home/myFolderName"

Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", myURL, False, myUserName, myPWD
WinHttpReq.send

but I'm getting a WinHttpReq.Status of 400 instead of the expected 200

what am I doing wrong?

thank you

Riccardo

Greg-DB
Dropbox Staff
Go to solution

In order to get an access token (and optionally a refresh token) for an account, your app should implement the OAuth app authorization flow. You can find information on how this process works in the OAuth Guide and authorization documentation

 

In your code snippet here, you seem to be attempting to access the Dropbox web site ("https://www.dropbox.com/home...") programmatically, which is incorrect. The Dropbox web site is only meant for use by web browsers.

 

The OAuth app authorization flow works by having the app direct the user to the Dropbox web site's app authorization page in the user's web browser, where the user chooses whether or not to authorize the app. If the user chooses to do so, the app will then get an access token (and optionally a refresh token) that it can use to make API calls.

Riccardo Chojwa
Explorer | Level 4
Go to solution

Hi Greg

thank you again for your prompt and hi-tech support

for the Token issue, I'll look into the OAuth Guide and authorization documentation. and see what I can dig out of it

for the Dropbox web site programatic access issue, is it incorrect/not meant for and yet feasable in some way?

Thanks
Riccardo

Greg-DB
Dropbox Staff
Go to solution

I'm not sure exactly what you were trying to build with that code, but no, you should not be attempting to programmatically access the Dropbox web site like that.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Riccardo Chojwa Explorer | Level 4
What do Dropbox user levels mean?