I am getting an error running getting a token from an API using the HTMLViewer. The advice from support was to check the Dev Console for the browser for Javascript errors. Is this possible using the HTMLViewer?
Please explain in more detail what you are doing. What API do you access? Why would an API use javascript?
It doesnt use JavaScript. Theyre telling him to access the developer tools like the ones available in a browser, but I dont believe our control exposes that.
Thanks. I am working with the DrChrono API.
The problem is that I am no longer getting a response when verifying an access token.
The code below was unchanged and just recently stopped working:
[code]Dim data As String = me.ReadAll
if InStr(data, “GET /?code=”) > 0 then
Dim successCode As String = Mid(data, 12, InStr(12, data, " ") - 12)
Dim mySocket As HTTPSecureSocket = new HTTPSecureSocket
Dim s As String = “code=” + successCode + “&client_id=” + client_id + “&client_secret=” + client_secret + “&redirect_uri=” + redirect_uri + “&grant_type=authorization_code”
mySocket.Secure = True
mysocket.SetRequestHeader(“Host”, “drchrono.com”)
mySocket.SetRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”)
mysocket.SetPostContent(s, “application/x-www-form-urlencoded”)
mySocket.SetRequestHeader(“Content-Length”, cStr(Lenb(s)))
s = mySocket.post(“https://drchrono.com/o/token/”, 0) \\<------This response “s” is now being returned as empty.
Dim j As New JSONItem(s)
if j.HasName(“refresh_token”) then
refreshToken = j.Value(“refresh_token”)
accessToken = j.Value(“access_token”)
WinAuthorize.Close
end if
end if
[/code]
If there is a Javascript error there likely is Javascript involved. Even if the HtmlViewer doesn’t support “Inspect Element” there is a url that the HtmlViewer is showing. Which can be copied to the browser.