I am trying to update my DNS with GoDaddy via their API (My home network is on a Dynamic IP).
I am able to succesfully update when using the script found at http://teanazar.com/2016/05/godaddy-ddns-updater/ when run through cygwin.
However I am trying to simply things, and do this in powershell instead.
However when trying to use the following script:
$IP = Invoke-WebRequest http://api.ipify.org?format=json
$IP2 = ConvertFrom-JSON $ip
$domain = 'example.com'
$type = 'A'
$name = '@'
$key = 'key'
$secret = 'secret'
$Request = @{ttl='600';data=$ip2.ip;priority='1'}
$JSON = Convertto-Json $request
$headers = @{}
$headers["Authorization"] = 'sso-key ' + $key + ':' + $secret
Invoke-WebRequest https://api.godaddy.com/v1/domains/$domain/records/$Type/$Name -contenttype "application/json" -method put -body $json -headers $headers
I have managed to work through each issue so far, and I know it is authenticating. But when I execute, i am getting "The Remote Server returned an error: (422) Unprocessable Entity