One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Cyber-Dog
7 years agoNew member | Level 2
Need Clarification on the redirect uri round-trip behviour (Desktop .Net)
Hey All,
Just after some clarification, Im familiar with programming desktop software but new to the web world.
In regards to OAuth 2, I have two options for the redirect set.
-https://www.dropbox.com/oauth2/redirect_receiver
-https://www.dropbox.com/1/oauth2/redirect_receiver
I got these out of the guide here,
https://blogs.dropbox.com/developers/2014/04/dropbox-authorization-in-a-windows-forms-app/
They work in getting an access token, though two things happen that dont seem to be right.
One) The page tab stayed open; either blank or with a 404 error depending on the redirect uir used.
Two) The following code fails, which is straight from the guide I linked above. I have tried converting to the Api v2 and still failed, I get a 400 error.
var client = new WebClient(); client.Headers["Authorization"] = "Bearer " + accessToken; var accountInfo = client.DownloadString("https://www.dropbox.com/1/account/info"); MessageBox.Show("Account info: " + accountInfo);
If calirication on the above could be explained that would be greatly appreciated.
Also, if you have any information on how I would make the url redirect back to my app after clicking Authroize, that would also be greatly appreciated
:)
- Greg-DB
Dropbox Staff
That blog post is relatively old, and utilizes a mechanism we no longer support, per the note at the top.
To answer your specific questions though, note that https://www.dropbox.com/oauth2/redirect_receiver does (without the "/1") does not appear in that post, and does not point to a valid page. Only https://www.dropbox.com/1/oauth2/redirect_receiver (with the "/1") is valid. Further, while we supply that for your convenience, you do not need to use it. You can use your own redirect URI if desired.
Also, https://www.dropbox.com/1/account/info is part of API v1, which has since been retired and no longer works.
Instead, to use the current Dropbox API from .NET, you should use the official Dropbox API v2 .NET SDK. There's information on getting started there, as well as examples. You can find documentation on how to process the OAuth app authorization flow with that here.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,946 PostsLatest Activity: 3 hours ago
If 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!