I am using postman to post " api-key, request-token and checksum" & header as "X-Kite-Version:3" to https://api.kite.trade/session/token. But getting this response. Kindly help and thanks in advance.
{ "status": "error", "message": "`api_key` should be minimum 6 characters in length.", "data": null, "error_type": "InputException" }
You need to POST api_key,request_token and checksum as body response as urlencoded data.
Go through this video
https://youtu.be/wHLrMyzdgJw
<?php
$request_token = $_GET['request_token'];
$status = $_GET['status'];
$action = $_GET['action'];
$apikey = "xxxxxxxxxx";
$apisecret = "XXXXXXXXXX";
$hash = hash('sha256', $apikey.$request_token.$apisecret);
$fields = array(
'api_key' => $apikey,
'request_token' => $request_token,
'checksum' => $hash
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.kite.trade/session/token",
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $fields,
CURLOPT_HTTPHEADER => array(
"X-Kite-Version: 3"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
print_r($response);
echo $err;
?>
kindly help me to find where i am getting it wrong.