Error while accessing API

Pranay456
Pranay456 edited May 27 in PHP client
While accessing the API, I am getting Error : invalid api_key or access token(PFA-Snapshot). The api_key is correct and access_token too. I have used api_key to generate request_token.

This is the PHP code I am using -

$url = "https://api.kite.trade/quote?i=41729&i=NSE:INFY";
// &X-Kite-Version=3&Authorization=token api_key:access_key
$header = array(
'X-Kite-Version' => '3',
'Authorization' => 'token api_key:access_key'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$head = curl_exec($ch);
curl_close($ch);
echo ($head);

help me solve the issue.
Tagged:
Sign In or Register to comment.