To obtain a Shiptheory API Token you'll need to run the below script, bear in mind that authentication tokens expire after 60 minutes.
$data = json_encode(
"email" => "email@example.com",
"password" => "yourpassword"
$ch = curl_init('https://api.shiptheory.com/v1/token');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Length: ' . strlen($data))
$result = curl_exec($ch);
Within the response will either be an error or the API token you'll need to make any other requests through Shiptheory, if you have any questions about this, feel free to contact support and we'll be happy to help or take a read through our API documentation