1

I am trying to develop client application for GoDaddy based on their API that they provided at https://developer.godaddy.com . I have a problem with the domain availability checking API which i'm checking with Postman app of Google chrome.

API Url: https://api.ote-godaddy.com/v1/domains/available

I have passed the following headers for the POST method:

'Accept' => "application/json", 'Authorization' => "sso-key $myKey:$mySecret"

The post data value is on "raw" format which is like - {"domain": ["omni7555.com"]}

I have searched alot for the issue on stackoverflow and find out a similar issue which is mentioned here: Godaddy api authorization error

But it does not work for me. I have also check the raw data value as ["omni7555.com"] which is also not worked well.

The API returns the following error -

{
  "errors": [
    {
      "message": "Invalid character(s) error",
      "path": "body.domains[0]",
      "domain": "[object Object]",
      "code": "INVALID_CHARACTERS",
      "status": 422
    }
  ],
  "domains": []
}

Can anyone help me to fix the issue.

localheinz
  • 9,179
  • 2
  • 33
  • 44

2 Answers2

1

Simply request https://api.ote-godaddy.com/v1/domains/available?domain=skgbazaar.com and you will get

<response><available>false</available><domain>skgbazaar.com</domain><definitive>true</definitive><price>7490000</price><currency>USD</currency><period>1</period></response>

1

I am using CURL and php with JSON. This is working for for me. Please try this code:

$domain = "jaisinghverma.com";<br>
$apiURL = 'https://api.ote-godaddy.com/v1/domains/available?domain='.$domain.'&checkType=FULL&forTransfer=false';<br>
$headers = array(
    'Accept: application/json',
    'Authorization: sso-key 2s83RziEFz_WKH7uMvTTgWX5RqNxADNTe:WKHARxNruKHyL3XbjoMp44',
);<br>
$ch = curl_init();<br>
curl_setopt($ch, CURLOPT_URL, $apiURL);<br>
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br>
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br>
$server_output = curl_exec ($ch);<br>
curl_close ($ch);<br>
print_r(json_decode($server_output));
loki
  • 9,816
  • 7
  • 56
  • 82