Error at RequestAccessToken

mendse_a edited September 2017 in .Net API client
 private void Form1_Load(object sender, EventArgs e)
kite = new Kite(MyAPIKey, Debug: false);



private void wb1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
string resurl= e.Url.AbsoluteUri;
if (resurl.Contains(""))

string RequestToken= resurl.Split(new char[] { '&' })[1].Split(new char[] { '=' })[1];
User user = kite.RequestAccessToken(RequestToken, MySecret);

/* Error Occuring here as like this
An exception of type 'KiteConnect.ParseException' occurred in KiteConnect.dll but was not handled in user code

string MyAccessToken = user.AccessToken;
string MyPublicToken = user.PublicToken;

  • tonystark
    tonystark edited September 2017
    Hi @mendse_a,

    Did you try to print request token? Probably this happens due to wrong data.

    You can also try to catch the exception and log response data in the console like this:
    User user = kite.RequestAccessToken(RequestToken, MySecret);
    }catch(ParseException e){
    Dictionary<string, dynamic> data = e.ResponseData;
    // check contents inside data
    You can use this function to print it to debug console.
  • mendse_a
    mendse_a edited September 2017
    Thanks it works
Sign In or Register to comment.