I am fetching data from thirdparty API using CURL in php. I have read the documentation and passing the same valid parameters to the request but nothing works. I am showing the code removing "API KEY" due to confidentiality.
$service_url = 'https://api.birdeye.com/resources/v1/business/147197756121167?api_key=ApiKeyGoesHere';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
if ($curl_response === false)
{
$info = curl_getinfo($curl);
curl_close($curl);
echo '<pre>';
die('error occured during curl exec. Additioanl info: ' . var_export($info));
}
curl_close($curl);
$decoded1 = json_decode($curl_response,true);
if (isset($decoded1->response->status) && $decoded1->response->status == 'ERROR')
{
die('error occured: ' . $decoded1->response->errormessage);
}
echo 'response ok!';
var_export($decoded1->response);
?>
The Output it gives me is : response ok!NULL
Link to the documenataion of birdeye API.
http://docs.birdeye.apiary.io/#reference/business/get/get-business
I have tried testing with Terminal it gives me response. Can Any One give me the way, where I am going wrong?