I am facing the error on the below code.
// Check if the exception class is defined.
if(class_exists($json->error_type)) {
throw new $json->error_type($json->message, $headers["status_code"]);
} else {
throw new GeneralException($json->message, $headers["status_code"]);
}
If I comment these lines it takes me throught. But user id is not retrieved.
Error same as first post. I am initialising login ftom kitelogin.php which includes api. I am passing the api key hardcoded. But receives the below error.
Authentication failed: Invalid session credentials
Fatal error: Uncaught TokenException (403) 'Invalid session credentials' thrown in /home/aarush11/public_html/kiteconnect.php on line 586
I have hardcorded everything and getting the below error. { "error_type": "ForbiddenError", "message": "Login session timed out. Please re-initiate the login.", "status": "error" }
access_token
is invalid. Can you please re initiate the login and get theaccess_token
again?Sorry I didn't understand what you mentioned. Where am i supposed to reinitiate login ?.
The flow is well described and illustrated.
// Check if the exception class is defined.
if(class_exists($json->error_type)) {
throw new $json->error_type($json->message, $headers["status_code"]);
} else {
throw new GeneralException($json->message, $headers["status_code"]);
}
If I comment these lines it takes me throught. But user id is not retrieved.
If there's no user_id, it means you the request is not happening correctly.
Authentication failed: Invalid session credentials
Fatal error: Uncaught TokenException (403) 'Invalid session credentials' thrown in /home/aarush11/public_html/kiteconnect.php on line 586
{
"error_type": "ForbiddenError",
"message": "Login session timed out. Please re-initiate the login.",
"status": "error"
}
<?php
include "kiteconnect.php";
$request_token = $_GET["request_token"];
$kite = new KiteConnect("5tcp3d8lpayuy1om");
echo "toke...".$request_token."\n";
try {
$user = $kite->requestAccessToken($request_token, "My_Secret_Key");
} catch(Exception $e) {
echo "Authentication failed: ".$e->getMessage();
}
print_r("User Name".$user);
But geting the following message
toke...2auswzidmt24vewos2mwo271jescm484 Authentication failed: That API call is not allowed for the authenticated userUser Name