<?php
    $ch = curl_init();
	if (!$ch)
    {
        die("Couldn't initialize a cURL handle");
    }
    curl_setopt($ch, CURLOPT_URL,$apiHTTPurl); // Target URL
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS,$apiData);
    $result = curl_exec ($ch);
    
    $quApiHit="INSERT INTO api_hit (Date,Time,TxnId,ApiName,Type,Disc) VALUES ('$date','$time','$newrechid','$api','RESULT','$result')";
	mysqli_query($con,$quApiHit);
	
	if($ApiName=="M_ROBO" || $ApiName=="M_ROBO2")
	{
	    $result = (array)json_decode($result);
	    $result = $result['data']; 
	}
	else
	{
	    $result = json_decode($result);
	}

?>