Start 2025 on time and up to date! Seamlessly integrate your calendars into Dropbox with these simple steps! 📆
Forum Discussion
SimonFan
8 years agoExplorer | Level 3
Problem to get the auth code
Hi All: I have a problem when I was trying to get the auth code. I am using WPF and tring to get the "auth-code-input" from the webpage that dropbox direct to. But the when I was using the following code it alway get null. For now, I set the redirct_uri to empty, does this matter?
mshtml.IHTMLDocument3 doc3 = WebBrowserAuth.Document as mshtml.IHTMLDocument3; var myHtmlElement = doc3.getElementById("auth-code-input"); string strAuthCode = myHtmlElement.getAttribute("value");
Many thanks in advance!
- Greg-DBDropbox Staff[Cross-linking for reference: https://stackoverflow.com/questions/44961671/dropbox-api-get-the-auth-code-issue ]
I'm not sure I understand your question, but it sounds like you may be trying to query the authorization code out of the HTML of the page after the user authorizes your app on /oauth2/authorize.
You shouldn't try to retrieve the authorization code that way, as that page is subject to change. If you want to get the authorization code programmatically, you should instead supply a redirect URI and get it from the URL parameter itself. You can find more information on how this works here:
https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,929 PostsLatest Activity: 2 days 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!