Version 1.24.2
Released: 2005-05-16
new
API for database quotas and access hostsextension of API for databases
list users on the database
CMD_API_DATABASES?action=users&db=user_dbname
list database disk usage for all databases
CMD_API_DATABASES?action=quota
list access hosts.
CMD_API_DATABASES?action=accesshosts&db=user_dbname
create access hosts
CMD_API_DATABASES?action=accesshosts&db=user_dbname&create=yes&host=hostvalue
delete access hosts
CMD_API_DATABASES?action=accesshosts&db=user_dbname&delete=yes&select0=val1&select1=val2&etc...
new
API for User and Admin Level DNS Administrationraw dump of the dns zone
CMD_API_DNS_CONTROL?domain=domain.com
Add a record:
CMD_API_DNS_CONTROL?domain=domain.com&action=add&type=A|NS|MX|CNAME|PTR&name=namevalue&value=recordvalue
Delete a record:
CMD_API_DNS_CONTROL?domain=domain.com&action=select&selecttype=encoded
where "selecttype" is one of arecs0, nsrecs0, mxrecs0, cnamerecs0, ptrrecs0 (0 and be any number, generally starting from zero, going up).
and also where "encoded" is the url encoded version of:
name=www&value=1.2.3.4
Basically, just replace the =, and & characters to html encoded charctes so that DA doesnt thing they are url separators. Take a look at the html generated in the CMD_DNS_CONTROL page for examples (the code is the same to handel the API and the CMD_API_DNS_CONTROL, it just uses different output).
CMD_API_DNS_ADMIN
functions work exactly the same as with CMD_API_DNS_CONTROL, except an admin account is required, and he can work on any domain.
Additional functions that come with the CMD_API_DNS_ADMIN command are:
delete zones:
CMD_API_DNS_ADMIN?action=delete&select0=domain.com&select1=domain2.com&etc..
create zone:
CMD_API_DNS_ADMIN?action=create&domain=domain.com&ip=1.2.3.4&ns1=ns1.domain.com&ns2=ns2.domain.com
if you also include &reverse=yes, then DA will add a reverse lookup for 1.2.3.4 pointing to domain.com, instead of the usual domain.com pointint to 1.2.3.4.
These API's are the beginning of multi server DNS. (just the beginning 😉)
UPDATE
Edit a record
To edit a record, it's a combination of first deleting a record, then adding a record.
So to do the edit, pass everything needed for action=delete, plus everything need for action=add, except you'd use action=edit.
Eg:
CMD_API_DNS_ADMIN?action=edit&domain=domain.com&type=A&arecs0=name%3Dmail%26value%3D1.2.3.4&name=mail&value=1.2.3.5
fixed
Subdomain deletion with "remove directory contents"https://forum.directadmin.com/showthread.php?p=47318