brew install tidy-html5
brew install xmlstarlet
EMAIL="[email protected]"
PASSWORD="mypassword"
CSRF=`curl -sS --cookie-jar cookies.txt https://www.united-domains.de/login | \
tidy -q -asxhtml --show-warnings no | \
xmlstarlet sel --html -t -m '//*[@id="login-form-1"]' -m '*[@name="csrf"]' -v '@value'`
curl -sS --cookie cookies.txt --cookie-jar cookieapi.txt -d "csrf=$CSRF" -d "selector=login" --data-urlencode "email=$EMAIL" --data-urlencode "pwd=$PASSWORD" -d "loginBtn=Login" https://www.united-domains.de/login
DOMAIN="mydomain.de"
SUBDOMAIN="apisubdomain"
DOMAINID=`curl -sS --cookie cookieapi.txt https://www.united-domains.de/pfapi/dns/domain-list | jq --compact-output --raw-output '.data[] | select(.domain=="$DOMAIN").id'`
SUBDOMAINID=`curl -sS --cookie cookieapi.txt https://www.united-domains.de/pfapi/dns/domain/$DOMAINID/records | jq --raw-output '.data.A[] | select(.sub_domain=="$SUBDOMAIN").id'`
echo $SUBDOMAINID
GET https://www.united-domains.de/pfapi/domains
{"data":["domain.de",...]}
GET https://www.united-domains.de/pfapi/dns/domain-list
{
"data": [
{
"id": "xxxx",
"domain": "xxxxx.de",
"configurable": true,
"domain_lock_state": {
"domain_locked": false,
"email_locked": false
}
}
]
}
GET https://www.united-domains.de/pfapi/dns/domain/:id/subdomain-list
{"data":["subdomain.xxxx.de"]}
GET https://www.united-domains.de/pfapi/dns/domain/:id/records
{
"data": {
"A": [
{
"address": "1.2.3.4",
"id": xxxxx,
"filter_value": "domain.de",
"ttl": 600,
"type": "A",
"standard_value": false,
"sub_domain": "",
"domain": "domain.de",
"webspace": false,
"udag_record_type": 5
},
{
"address": "2.3.4.5",
"id": xxxxx,
"filter_value": "subdomain.domain.de",
"ttl": 600,
"type": "A",
"standard_value": false,
"sub_domain": "*.subdomain",
"domain": "domain.de",
"webspace": false,
"udag_record_type": 5
}
],
"AAAA": [],
"MX": [
{
"prio": 10,
"mail_server": "mx00.udag.de",
"id": xxxxx,
"filter_value": "domain.de",
"ttl": 3600,
"type": "MX",
"standard_value": true,
"sub_domain": "",
"domain": "domain.de",
"webspace": false,
"udag_record_type": 4
},
"TXT": [
{
"text": "k=rsa; p=xxxxx",
"id": xxxxxx,
"filter_value": "yyyy._domainkey.domain.de",
"ttl": 600,
"type": "TXT",
"standard_value": false,
"sub_domain": "yyyy._domainkey",
"domain": "domain.de",
"webspace": false,
"udag_record_type": 5
}
],
"SRV": [],
"CNAME": [
{
"target": "domain.de",
"id": xxxxx,
"filter_value": "www.domain.de",
"ttl": 600,
"type": "CNAME",
"standard_value": false,
"sub_domain": "www",
"domain": "xxxxx.de",
"webspace": false,
"udag_record_type": 5
}
],
"NS": [],
"CAA": [
{
"flag": 0,
"tag": "issuewild",
"value": "letsencrypt.org",
"id": xxxxx,
"filter_value": "domain.de",
"ttl": 600,
"type": "CAA",
"standard_value": false,
"sub_domain": "",
"domain": "domain.de",
"webspace": false,
"udag_record_type": 5
}
]
}
}
PUT https://www.united-domains.de/pfapi/dns/domain/:id/records
Based on type (see (Get Domain Record)[#get_domain_record]) provide a appropriate record structure
{
"record": {
"id": null,
"type": "A",
"sub_domain": "new-subdomain",
"domain": "domain.de",
"ttl": 600,
"filter_value": "",
"standard_value": false,
"address": "100.100.100.100",
"webspace": false,
"formId": "A0"
},
"domain_lock_state": {
"domain_locked": false,
"email_locked": false
}
}
GET https://www.united-domains.de/pfapi/dns/domain/:id/export