// Initialise. $kite = new KiteConnect($apiKey, null, null, true);
// Assuming you have obtained the `request_token` // after the auth flow redirect by redirecting the // user to $kite->login_url() try { $user = $kite->requestAccessToken($token, $apiSecret);
Request: https://api.kite.trade/session/token array(3) { ["request_token"]=> string(32) "xxxxxxxxx" ["checksum"]=> string(64) "xxxxxxxxxxxxxxxxx" ["api_key"]=> string(16) "xxxxxxx" } Response :{"status": "error", "message": "That API call is not allowed for the authenticated user", "error_type": "PermissionException"} Authentication failed: That API call is not allowed for the authenticated user Fatal error: Uncaught PermissionException (403) 'That API call is not allowed for the authenticated user' thrown in F:\public_html\kite\kiteconnect.php on line 668
Our main requirement is to get updated market rates, so we opted for Kite.Trade Websockets, We have successfully connected to websockets using login authentication flow and grabbing public_token.
Question is, it possible to do that without login authentication flow is it possible to get the public_token which can be used anywhere in client app (like in mobile apps) or server side, so that we can push updated market price for specific STOCK (instrument).
Hi Kailash, thanks for your revert, we've an app (IOS and android) we want to reflect live market prices there, and have a single Kite Connect account, we want to use that account to authenticate all users, would that be acceptable by kite terms of use and is there multi session allowed?
Hi @amanrawat , multi-user login is possible if you are building a platform (but it'll need exchange approvals). Please e-mail [email protected] regarding getting empanelled as a startup.
Authentication failed: Invalid session credentials
Fatal error: Uncaught TokenException (403) 'Invalid session credentials' thrown in C:\xampp\htdocs\kiteconnect.php on line 529
Even though I am not Logged-In in any other system.
include "kiteconnect.php";
$kite = new KiteConnect("$api_key");
try {
$user = $kite->requestAccessToken("$request_token", "$secret_key");
echo "Authentication successful. \n";
print_r($user);
$kite->setAccessToken($user->access_token);
} catch(Exception $e) {
echo "Authentication failed: ".$e->getMessage();
throw $e;
}
Where is $request_token's value being set in your example?
<?php
$apiKey = 'xxxxxx';
$token = $_GET['request_token'];
$apiSecret = 'xxxxxx';
include dirname(__FILE__) . "/kiteconnect.php";
// Initialise.
$kite = new KiteConnect($apiKey, null, null, true);
// Assuming you have obtained the `request_token`
// after the auth flow redirect by redirecting the
// user to $kite->login_url()
try {
$user = $kite->requestAccessToken($token, $apiSecret);
echo "Authentication successful. \n";
print_r($user);
$kite->setAccessToken($user->access_token);
} catch (Exception $e) {
echo "Authentication failed: " . $e->getMessage();
throw $e;
}
echo $user->user_id." has logged in";
and i am getting a response
Request: https://api.kite.trade/session/token array(3) { ["request_token"]=> string(32) "xxxxxxxxx" ["checksum"]=> string(64) "xxxxxxxxxxxxxxxxx" ["api_key"]=> string(16) "xxxxxxx" } Response :{"status": "error", "message": "That API call is not allowed for the authenticated user", "error_type": "PermissionException"} Authentication failed: That API call is not allowed for the authenticated user
Fatal error: Uncaught PermissionException (403) 'That API call is not allowed for the authenticated user' thrown in F:\public_html\kite\kiteconnect.php on line 668
Hoping for a quick reply
Detailed documentation -- https://kite.trade/docs/phpkiteconnect/class-KiteConnect.html
Can you tell me how to retrieve INDIA VIX ?
Question is, it possible to do that without login authentication flow is it possible to get the public_token which can be used anywhere in client app (like in mobile apps) or server side, so that we can push updated market price for specific STOCK (instrument).
Please revert in this regard