API v2 domain update data

Posted June 26, 2017 3.8k views
APIUbuntu 16.04

so i created bash script to update one single domain, and domain pings to my server, but it stopped working few days ago can you help me:

my script logs:

Machine IP:
Domain config: {"domain_record":{"id":XXXXXX,"type":"A","name":"XXXXXXXX","data":"","priority":null,"port":null,"ttl":3600,"weight":null}}
Update domain DNS required!
Domain Old Ip:
New Ip:
Response of Domain DNS update: {"id":"not_found","message":"The resource you were accessing could not be found."}

where is the issue? if worked i dont know, few days ago

edited by asb

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

As it says, “The resource you were accessing could not be found.”. Double check the ID.

  • Yes, I can read and I also compared thous id, and its compeleatly the same as in first response. It worked time ago, and i don`t think that domain id is not unique and floating id witch updates in one domain/sub-domain lifecycle

    there is my bash code:

    # Ubuntu package "jq" should be inststalled on machine
    ip=$(curl -ss
    echo "Machine IP: $ip"
    token="XXXXXXX" // tocen form my account
    domain="XXXXXXX" // domain name (not sub)
    record="XXXXXX" // sub-domain id
    cdd=$(curl -ss GET -H "Content-Type: application/json" -H "Authorization: Bearer $token" "$domain/records/$record")
    echo "Domain config: $cdd"
    doDomainIp=$(echo $cdd | jq '' | tr -d '"')
    if [ "$ip" != "$doDomainIp" ]; then
        echo "Update domain DNS required!"
        echo "Domain Old Ip: $doDomainIp"
        echo "New Ip: $ip"
    call=$(curl -ss PUT -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{"data":"'$ip'"}' "$domain/records/$record")
        echo "Response of Domain DNS update: $call"
        echo "Domain is setted up!"
        echo "Machine ip: $ip"
        echo "Domain ip: $doDomainIp"
    edited by asb
    • Show the output of list domains and stop hiding the ID and domain - they’re not private.

      • domain=""

        and sub-domain name i preffeare to leave hidden form of it is like:

        and output of this bash script is in first post:

        edited by asb