Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hey Guys, Im new here, i need help. i trying to make vb app using dropbox as cloud storage, for team work.
I already read the dropbox blog but it confuse me. i cant read the flow or what variable i should change. i know the first step is get autorization for the account but the flow confuse me. what i should change or what i should do ? please help me
Imports Dropbox
Imports Dropbox.Api
Imports System.Threading
Imports System.Text
Public Class Form1
Public Shared Function GetAuthorizeUri(
clientId As String,
Optional disableSignup As Boolean = False
) As Uri
End Function
Public Shared Function ParseTokenFragment(
redirectedUri As Uri
) As OAuth2Response
End Function
Public Shared Function ProcessCodeFlowAsync(
code As String,
appKey As String,
appSecret As String,
Optional redirectUri As String = Nothing,
Optional client As MdiClient = Nothing
) As Task(Of OAuth2Response)
End Function
End Class
As a first step, I recommend running the SimpleBlogDemo sample app and looking through how that works. For example, HomeController.cs shows how to use these methods to set up and process the OAuth app authorization flow.
hey i try your example, but it stuck when redirected to https://www.dropbox.com/1/oauth2/redirect_receiver white page and i cant catch the token acces and here i'm. but thanks by the way now i star to understand it
Imports System.Web
Imports System.Net
Imports System.Text
Imports System.Windows.Forms
Imports Dropbox
Imports Dropbox.Api
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Be sure to replace this with your app key from dropbox.com/developers/apps.
Dim clientID = "oxug9jwop2ktf38"
' The redirect URI you use doesn't really matter, so feel free to use something else,
' but this is one we've set up specifically for client-side apps to use.
Dim redirectUri = New Uri("https://www.dropbox.com/1/oauth2/redirect_receiver")
Dim uri = String.Format("https://www.dropbox.com/1/oauth2/authorize?response_type=token&redirect_uri={0}&client_id={1}", redirectUri, clientID)
WebBrowser1.Navigate(uri)
End Sub
' This method gets called when the WebBrowser control loads a new page.
Private Sub webBrowser1_Navigated(sender As Object, e As WebBrowser)
' Make sure that this is our redirect page.
If (e.Url.AbsoluteUri.StartsWith("https://www.dropbox.com/1/oauth2/redirect_receiver")) Then
End If
' Parse out the access token from the URL fragment.
Dim accessToken = HttpUtility.ParseQueryString(e.Url.Fragment.Substring(1))("acces_token")
' TODO: Save the access token somewhere so the user doesn't need to log in the next time!
' Make a call to /account/info to verify that the access token is working.
Dim client = New WebClient()
client.Headers("Authorization") = "Bearer " + accessToken
Dim accountInfo = client.DownloadString("https://www.dropbox.com/1/account/info")
MessageBox.Show("Account info: " + accountInfo)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.alamat.Text = Me.WebBrowser1.Url.ToString
End Sub
End Class
the URI, after login, the flow should take me to page that contain acces token but when i done with login, the next page is blank and when i look the code, it should display a message box contain my account info using my acces token. i already got the access token, but the problem is take it and store from url
Hi there!
If you need more help you can view your support options (expected response time for a 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!