Everything is fine but response is :
{“status”:“success”,“data”:}
<?php
include 'core/core.php';
$curl = curl_init();
$options = array(
CURLOPT_URL => 'https://api.upstox.com/v2/option/chain?instrument_key=NSE_FO%7C60332&expiry_date=2024-03-28',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer ' . getAccessTokenFromCookies()
)
);
curl_setopt_array($curl, $options);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
echo getAccessTokenFromCookies();
?>
Please see the thread mentioned below. It appears you might be making the same error.
Thanks sir, this information is really helpful for me.