@AnkurGoyal Can you re-check, if you are entering the correct request_token to generate access_token? Also, once request_token is used to generate an access token. Request token expires immediately after that. And it cannot be reused further, make sure you are not re-using the same.
Can you re-check, if you are entering the correct request_token to generate access_token?
Also, once request_token is used to generate an access token. Request token expires immediately after that. And it cannot be reused further, make sure you are not re-using the same.
But the same code was working a day before.
Can you paste your code here? We will look to it.
session_start();
$apikey = 'xxxxxxxx';
$secret = 'xxxxxxxx';
include "kiteconnect.php";
$kite = new KiteConnect($apikey);
if (isset($_SESSION['Access'])) {
$Access = $_SESSION['Access'];
$kite->setAccessToken($Access);
}else{
if ( !isset($_GET['request_token']) ) {
header("Location: https://kite.trade/connect/login?api_key=$apikey");
die();
}
$request = $_GET['request_token'];
try {
$user = $kite->generateSession($request, $secret);
$kite->setAccessToken($user->access_token);
$Access = $user->access_token;
$_SESSION['Access'] = $Access;
} catch(Exception $e) {
die($e);
}
}
?>
This query is still not clear.