I am trying to develop client application for GoDaddy based on their API that they provide here https://developer.godaddy.com 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' => 'https://api.godaddy.com',
]);
$responce = $client->get(
'/v1/domains/available?domain=example.guru',
[
'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?
Overview. The GoDaddy API allows developers to interact with the GoDaddy system in the same way we do. The API can be used by anyone who wants to manage their domains and account or create their own experience for registering, purchasing, and managing domains.
GoDaddy API is offered to all users free of charge. You will need an API Key and Secret to authenticate and authorize your requests.
The Customer Number in the report is the shopper ID of each sub-account, you can call this API (https://developer.godaddy.com/doc/endpoint/shoppers#/v1/get) to retrieve further information.
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 https://api.ote-godaddy.com
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' https://api.godaddy.com/v1/domains/available?domain=example.guru'
Let us know how it works out!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With