Authentication fail error

gkannan1965
Hi,

I am getting following error.
"That API call is not allowed for the authenticated user"

How can I fixed this?
my api_key is a7w4dd17w5bp4nb5.

Trading id: DU0139

Thanks
  • Vivek
    Seems like its an publisher app with only permissions basket orders only. You need to create "connect" app to access full api.
  • gkannan1965
    Thanks Vivek, checked and created connect app. Now I am able to login.
  • jitendra
    I am not able to use kiteconnect API.Getting the following error:

    Authentication failed: Invalid session credentials
    Fatal error: Uncaught TokenException (403) 'Invalid session credentials' thrown in C:\xampp\htdocs\kiteconnect.php on line 586


    Following are my code:

    include 'kiteconnect.php';

    //Hard coded values
    $api_key = "xxxxxxxx";
    $secret_key = "yyyyyyyyy";

    // Incoming from the redirect.
    $request_token = $_GET["request_token"];
    echo "
    Request Token is: ".$request_token;

    $checksum = hash("sha256", $api_key . $request_token . $secret_key);
    echo "
    CheckSum is: ".$checksum;

    $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;
    }
    echo $user->user_id." has logged in";
  • Kailash
    @jitendra Please share your api_key? You've created a Connect app and not a Publisher app, right?
  • jitendra
    Hi Kailash, My API key is t7m1bayvj0akeo1f.
    I have created KITE CONNECT + PUBLISHER app.
    Please let me know what needs to be done.?
  • Kailash
    @jitendra I copy-pasted your code snippet and tested and it worked without any change. The only thing I did was insert my api_key, secret_key and remove the checksum line (as you don't need to compute the checksum yourself).

    Please make sure you've copied the api_key and secret as-is (no extra spaces or characters).
Sign In or Register to comment.