I recently got a new job. They need me to get information from ShipStation through the API using PHP. I'm fairly new to PHP and even newer to ShipStation. I copied the code from the API documentation and attempted to add the code for authorization. This is what I've got:
<?php
$apiKey = "my_api_key";
$apiSecret = "my_api_secret";
$auth = base64_encode($apiKey . ":" . $apiSecret);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://ssapi.shipstation.com/orders");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: Basic " . $auth
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
?>
Instead of giving me order information it's just returning bool(false)
.
I guess I'm just not seeing what I'm doing wrong. Any help would be greatly appreciated. Thanks!