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: 

Re: Get token how witohout CURL

get Auth token with AppKey and Appsecret error

OLIM
Explorer | Level 3

OLIM_0-1669642888723.pngOLIM_1-1669643025757.png

Why did the freaks remove the possibility of eternal tokens? now we'll have to look for another service, redo all the applications.

21 Replies 21

OLIM
Explorer | Level 3

does anyone have a real example of getting a token of this ugly service, these have all the examples in curl

Здравко
Legendary | Level 20

Hi @OLIM,

I'm not sure what you ask for actually, but your example has nothing to do about tokens. There Basic authentication is used and it's something specific to this type of authentication, not just something Dropbox specific, and has always been performing using base64 encoding. You can't just concatenate the things!

About tokens, new issued access token is always short lived. There was time when long lived access token used to issue and such tokens, if you have some, are still usable, but are deprecated currently. If you want long lived access you need refresh token. It doesn't expire automatically. Take a look here for more info.

Hope this helps.

OLIM
Explorer | Level 3

Hi there. I didn't find a way to generate a token, I accidentally deleted the old eternal token, now it can't be restored. And new tokens live for 4 hours. All software and applications have stopped working, customers are complaining. It is clear that I'have to find another service for applications. But I haven't found yet, do you know a third-party service that would pull tokens from the dropbox by Appkey and AppSecret. My applications are installed on devices that do not have access to the browser, it is required that the application does not require authorization data. Everything should be sewn in. And this is impossible with the current policy of Dropbox.

OLIM
Explorer | Level 3

give me a real example for getting a token if you are truthful. For example, in VBA. curl it is not possible to run on the client machine. It doesn't work with EncodeBase64 either, if that's what you're talking about.

OLIM
Explorer | Level 3

OLIM_0-1669656201399.png

does not take all values of grant_type

Здравко
Legendary | Level 20

Don't make partial posting! 🤔 Where is the code actually?

OLIM
Explorer | Level 3

Function gettoken(appkey, appsecret, accesscode) As String

         Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
         http.Open "POST", "https://api.dropboxapi.com/oauth2/token", False
         http.setRequestHeader "Authorization", "Basic " & EncodeBase64(appkey & ":" & appsecret)
         http.setRequestHeader "Content-Type", "application/json"
         http.setRequestHeader "grant_type", "authorization_code"
         http.Send ("{""oauth1_token"":""i dont now what is it"",""oauth1_token_secret"":""i dont now what is it""}")
         gettoken = http.ResponseText
End Function

Здравко
Legendary | Level 20

@OLIM wrote:

...
         http.Send ("{""oauth1_token"":""i dont now what is it"",""oauth1_token_secret"":""i dont now what is it""}")
...


Me too... 🤷 Where came "oauth1_token" and "oauth1_token_secret" from? Do you have some outdated v1 tokens and want to transform them to v2 (the actual one)? You need to provide the temporary code to confirm the authentication - token provided as result of authorization. Did you read carefully the referred topic I linked to? I (or somebody else) haven't posted there anything similar!

 

By the way... "grant_type" is parameter, not header!

 

This call can be performed with GET request, so, I hope, you can make you life easy. 😉

OLIM
Explorer | Level 3

да я уже что попадается то и вкладываю из примеров, целый день убил на это

перекинул code на параметр, теперь говорит  : ResponseText : "{"error": "invalid_grant", "error_description": "code doesn't exist or has expired"}" : String 

заебался короче

нету просто токен годовой хотя бы, надо все усложнаять

Need more support?