Support - Zerigo DNS

REST API v1.1 - example code

Curl

Because REST API's are inherently built on HTTP, it is easy to perform at least basic interaction using readily available tools like Curl. What follows are some basic examples that should be easy to build upon.

GET requests
curl --basic --user 'test@example.com:8944a55vubi7gp2tthq8pwuljau4n8cn' \
http://ns.zerigo.com/api/1.1/zones/12345678/hosts.xml
POST requests
curl --basic --user 'test@example.com:8944a55vubi7gp2tthq8pwuljau4n8cn' \
--header 'content-type: application/xml' --data @host.xml \
http://ns.zerigo.com/api/1.1/zones/12345678/hosts.xml

host.xml contains the XML body to send to the server.

PUT requests
curl --basic --user 'test@example.com:8944a55vubi7gp2tthq8pwuljau4n8cn' \
--header 'content-type: application/xml' --data @host.xml --request PUT \
http://ns.zerigo.com/api/1.1/zones/12345678/hosts/23456789.xml

host.xml contains the XML body to send to the server.

DELETE requests
curl --basic --user 'test@example.com:8944a55vubi7gp2tthq8pwuljau4n8cn' \
--request DELETE \
http://ns.zerigo.com/api/1.1/zones/12345678/hosts/23456789.xml