cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

API - How to update nameservers

Hi,

I'm trying to use the API to set custom nameservers, e.g.:

 

curl -X PATCH "https://api.ote-godaddy.com/v1/domains/12300000000000.com" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: sso-key <mykeys>" -d "{ \"nameServers\": [\"dn1.test.com\",\"dn2.test.net\"]}"

No matter how I try, I get something like this:

{"code":"INVALID_BODY","fields":[{"code":"FAILED_NAME_SERVER_VALIDATION","message":"Failed to update nameservers","path":"body.nameServers"}],"message":"Request body doesn't fulfill schema, see details in `fields`"}


So what's the proper way to do this ?
 
Thanks,
Greetings,
    Sorin (sorincalex@gmail.com)
2 REPLIES 2
Helper V

Re: API - How to update nameservers

I knew nothing about the API but I did try the sample in the Get Started. It took a few tries to get it to work for me.Does that sample work for you?

 

In that sample they say to replace API_KEY and API_SECRET with your API Key and Secret but they are not clear about the brackets []; I tried with and without and apparently we are supposed to replace those to. Since your curl command is not clear to understand I am not sure but probably you are using [] so try without them.

 

Also, I see that some keys are for testing and some for production. I assume you need a production key; are you sure your key is correct?

 

Also, it helps to format code. People that want to help you will appreciate it. For example:

 

{
   "code": "INVALID_BODY",
   "fields": [
      {
         "code": "FAILED_NAME_SERVER_VALIDATION",
         "message": "Failed to update nameservers",
         "path": "body.nameServers"
      }
   ],
   "message": "Request body doesn't fulfill schema, see details in `fields`"
}

 

Re: API - How to update nameservers

Thank you for your answer.
I also try the samples and usually they work. In the case I mentioned, they didn't work anymore. 
Namecheap, for example, offers a sandbox account where you can experiment with their API. I wish GoDaddy offered a similar functionality, because trying their samples is like a blind date. My keys are the ones created on GoDaddy website (https://developer.godaddy.com/keys).