Say for example I have a domain 'example.com'. I want to update 'A' type record like 'test' with some TTL value in order to have the domain 'test.example.com'. How can we do that in node js? Is there any module available? Thanks in advance!
I tried with the following ajax request. But It shows error. Can anyone please help me out?
$.ajax({
type: 'PATCH',
url: 'https://api.ote-godaddy.com/v1/domains/{domain}/records',
data: {
'domain': 'example.com',
'records': [{
'type': 'A',
'name': 'test',
'data': '000.59.47.201'
}]
},
headers: {
'Authorization': 'sso-key {key}:{secret}',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
},
success: function(body) {
console.log(body);
}
});
I suspect the reason for the ajax error you are getting might because of API keys. In GoDaddy two environments are available called ote and production. For the ajax API call you will receive an error when you are trying to use ote environment keys to production keys and vice-versa.
Also, there is an npm module available for your case. Here is the link for that module https://www.npmjs.com/package/godaddy-dns