You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Lukag
5 months agoCollaborator | Level 8
Error 404 Server remote no found
I have an expired token so to get a new one. I try with this code but i have the error Error 404 Server remote no found. I use https://api.dropbox.com and https://api.dropboxapi.com with the sam...
- 4 months ago
Lukag wrote:I changed my code but i have an error 400 Bad request
...
Hm..🤔 You didn't mention, but let me guess: the error message states - unsupported grant type or so. Right?
What grant type you're using EXACTLY? 🧐 Focus on "exactly"! Even one letter - more or less - may make the things wrong. 😉
PS: Print out what you're passing as body text and compare what has to be as we discussed in previous threads. Does it match?
Lukag
Collaborator | Level 8
I changed my code but i have an error 400 Bad request
(I try with api.dropboxapi.com and with api.dropbox.com , which one is the right one ? )
Dim _command As String
_command = "https://api.dropboxapi.com/oauth2/token "
Dim Request As HttpWebRequest
Request = HttpWebRequest.Create(_command)
Request.Method = "POST"
Request.KeepAlive = True
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls12 Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls
Request.ContentType = "application/x-www-form-urlencoded"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
ServicePointManager.SecurityProtocol = CType(48, SecurityProtocolType) Or CType(192, SecurityProtocolType) Or CType(768, SecurityProtocolType) Or CType(3072, SecurityProtocolType)
Request.AllowAutoRedirect = True
Dim postbody As String = "&grant_type=refresh_token "
postbody += "&refresh_token=" & _refresh_token
postbody += "&client_id=" & _App_key
postbody += "&client_secret=" & _App_secret
Dim payload = Encoding.UTF8.GetBytes(postbody)
Request.ContentLength = payload.Length
Using dataStream = Request.GetRequestStream()
dataStream.Write(payload, 0, payload.Length)
End Using
Try
Using response = CType(Request.GetResponse(), HttpWebResponse)
Using reader = New IO.StreamReader(response.GetResponseStream())
_file = reader.ReadToEnd()
End Using
End Using
Catch ex As WebException
Using response = CType(ex.Response, HttpWebResponse)
Using reader = New IO.StreamReader(response.GetResponseStream())
_errore = reader.ReadToEnd()
End Using
End Using
Catch ex As Exception
Throw
End Try
Здравко
4 months agoLegendary | Level 20
Lukag wrote:I changed my code but i have an error 400 Bad request
...
Hm..🤔 You didn't mention, but let me guess: the error message states - unsupported grant type or so. Right?
What grant type you're using EXACTLY? 🧐 Focus on "exactly"! Even one letter - more or less - may make the things wrong. 😉
PS: Print out what you're passing as body text and compare what has to be as we discussed in previous threads. Does it match?
- Lukag4 months agoCollaborator | Level 8
the problem was that i put a space after refresh_token ...you can see "&grant_type=refresh_token "
( i use https://api.dropboxapi.com/oauth2/token and it works )
Thank you very much
- Greg-DB4 months agoDropbox Staff
Thanks for following up. I'm glad to hear you got that working. For reference, both api.dropbox.com and api.dropboxapi.com are acceptable for this.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!