$file = file_get_contents("./config.json");
$config = json_decode($file, true);
$environment = ($config["sandbox"] === true) ? "development" : "production";
$certfile = $config[$environment]["certificate_name"];
$curl = curl_init();
curl_setopt_array($curl, array (
CURLOPT_URL => $location,
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_SSLCERT => $certfile,
CURLOPT_SSLCERTPASSWD => "",
CURLOPT_HTTPHEADER => array (
"Authorization: Bearer " . $access_token,
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
echo $response;