How to pass an extra parameter while requesting Request_token

akhileshKhajuria
I have a system that links Zerodha account to Google account.
Now once I generate a request token it redirects me to Redirect URL which is a constant. But now I do not know which user has sent the request token.
I need to pass a parameter somehow to identify the user when he sends back a request token. How do I do that?

Thanks in advance.
  • Vivek
    You can pass a query param called `redirect_params` which will be appended to redirect url once login is successfull. Lets say you want to get back field called `user_id` in redirect then encode `user_id=abcd` and send it using `redirect_params`. For example
    Login url - https://kite.zerodha.com/connect/login?api_key=your_api_key&redirect_params=user_id%3Dabcd
    Redirect url - https://kite.trade/?request_token=nCsQ1GUMkdtxoWp5Az37Ad3GO9EuHYY4&action=login&status=success&user_id=abcd
Sign In or Register to comment.