Network_SPY Network_SPY - 1 year ago 351
PHP Question

Godaddy api authorization error

I am trying to develop client application for GoDaddy based on their API that they provide here
And I have a problem with simple example, I am trying to use the next PHP code to check if domain available:

use GuzzleHttp\Client;
try {
$client = new Client([
'base_uri' => '',

$responce = $client->get(
'headers' => [
'Authorization' => "sso-key $myKey:$mySecret",
'X-Shopper-Id' => "$myID",
'Accept' => 'application/json',
echo $responce->getBody();
} catch (Exception $e) {
echo $e->getMessage();

And all the time I get error: "Client error: 401". Same problem I have with using cURL library. I didn't find any online support.
I need help with it, can someone explain how I should authorize at their api service? Maybe I need to send any other http headers or additional params?

Answer Source

Are the key and secret you're using for production? When I go through the process, by default it creates a TEST key/secret, which I think are meant to go against

If you are using production keys, try doing a manual Curl request from the command like; something like:

curl -H 'Authorization: sso-key {KEY}:{SECRET}' -H 'Content-Type: application/json''

Let us know how it works out!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download