cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Unable to create A record through REST API

I am trying to add "A" record through REST API and I am getting following error

 

{
  "code": "UNKNOWN_DOMAIN",
  "message": "The given domain is not registered, or does not have a zone file"
}

Example curl command

 

 

curl -X PATCH "https://api.ote-godaddy.com/v1/domains/mydomain/records" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: sso-key ssosso" -d "[ { \"data\": \"data\", \"name\": \"name\", \"port\": 1, \"priority\": 1, \"protocol\": \"string\", \"service\": \"string\", \"ttl\": 600, \"type\": \"A\", \"weight\": 1 }]"

 

 

 

I am using following API guide

https://developer.godaddy.com/doc/endpoint/domains#/v1/recordAdd

 

I am using following name servers

 

 

ns35.domaincontrol.com
ns36.domaincontrol.com

 

 

I am able to add "A" record manually through UI. I am trying to automate it using script.

 

Already tried to contact support. They were not able to support.

1 ACCEPTED SOLUTION
Super User IV

@dheerajjoshim 

 

Based on what you posted below you are using the test environment (api.ote-godaddy.com) vs the production (api.godaddy.com)

 

If you are just testing things out, you would first need to register the domain in the test environment and then you can make updates

I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

View solution in original post

2 REPLIES 2
Super User IV

@dheerajjoshim 

 

Based on what you posted below you are using the test environment (api.ote-godaddy.com) vs the production (api.godaddy.com)

 

If you are just testing things out, you would first need to register the domain in the test environment and then you can make updates

I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

View solution in original post

Yes. I was using wrong API.

Thanks for the help