API Documentationv2
API Documentationv2
0
Documentation
6/07/2012
TABLE OF CONTENTS Overview...................................................................................................... 3 Making A Request ......................................................................................... 3 Rate Limiting ................................................................................................. 3 Supported Data Formats ............................................................................... 3 Try it! Getting Started.................................................................................... 3 Authentication .............................................................................................. 4 Common Header Fields ................................................................................. 6
Request Headers ..................................................................................................................................... 6 Response Headers .................................................................................................................................. 6
Data Types & Example Calls .......................................................................... 7 Domain.......................................................................................................... 8 MultiDomain ............................................................................................... 12 SOA Record ................................................................................................. 15 Vanity DNS .................................................................................................. 17 Template ..................................................................................................... 18 ACL .............................................................................................................. 20 Folder .......................................................................................................... 21 Query Usage ................................................................................................ 22 Failover ....................................................................................................... 24 Record ......................................................................................................... 26 Resources & Methods .................................................................................30 Managed Domain ........................................................................................ 30 Managed Records........................................................................................ 31 Template Records........................................................................................ 31 Secondary Domain ...................................................................................... 33 Secondary Records ...................................................................................... 33 Template Records........................................................................................ 34 Query Usage ................................................................................................ 35 Error Reporting ...........................................................................................36 Generic API Error ........................................................................................... 3
REVISION HISTORY 21-May-12 ................................................................................. Initial Release 07-June-12 ..................................................... Data Types & Examples Update
Overview
Making A Request
REST requests can be made via HTTPS or HTTP by using the headers, authentication, data types, and methods specified below. The current endpoint for the API V2.0 is available at http[s]://api.dnsmadeeasy.com/V2.0/
Rate Limiting
To prevent unwanted flooding of the API system, there is a maximum number of requests that can be sent in a given time period. This limit is 150 requests per 5 minute scrolling window. For example, 100 requests could be made in one minute, followed by a 5 minute wait, following by 150 requests. This limit is tracked per API key and all requests count toward this limit. Refer to the x-dnsme-requestLimit and x-dnsme-requestsRemaining header fields for values related to this limit.
perl -MCPAN -e "install Config::Properties" Download the following DNS Made Easy files and save them into the same location: o dnsmeapi.properties o dnsmeapi.pl Put your API and Secret Keys into the dnsmeapi.properties file, the location of these keys is specified below in the Authentication section. Make requests using the dnsmeapi.pl script as a wrapper around cURL! For example:
perl dnsmeapi.pl http://api.dnsmadeeasy.com/V2.0/dns/managed/ -H accept:application/xml perl dnsmeapi.pl http://api.dnsmadeeasy.com/V2.0/dns/managed/example.com -X perl dnsmeapi.pl http://api.dnsmadeeasy.com/V2.0/ dns/managed/12345/records -H accept:application/json
cURL accepts the -X option to set the HTTP method used for the request (GET is used if no method is specified). cURL accepts the H option to set HTTP headers for the request.
Authentication
Authentication with the DNS Made Easy API is done using the API and Secret keys, given on a per-account basis. The values for these keys can be found on the Account Information page under the Config menu after you log in. To make an authenticated request, follow these steps: Create the string representation of the current date and time in HTTP format. Example: Sat, 12 Feb 2011 20:59:04 GMT Calculate the hexadecimal HMAC SHA1 hash of that string using your Secret key as the hash key. Example: b3502e6116a324f3cf4a8ed693d78bcee8d8fe3c
Set the values for the request headers using your API key, the current date and time, and the HMAC hash that you calculated. This example was created using a Secret key of c9b5625f-9834-4ff8-baba-4ed5f32cae55:
o x-dnsme-apiKey:1c1a3c91-4770-4ce7-96f4-54c0eb0e457a o x-dnsme-requestDate:Sat, 12 Feb 2011 20:59:04 GMT o x-dnsme-hmac:b3502e6116a324f3cf4a8ed693d78bcee8d8fe3c
Requests must be sent shortly after these headers are generated. If too much time has passed between when the x-dnsme-requestDate and x-dnsme-hmac strings were created and when the request is received by the DNS Made Easy API servers, then the request will be denied. Requests made with invalid credentials or an invalid x-dnsme-requestDate value will receive an HTTP 403 Forbidden response.
x-dnsme-requestDate
x-dnsme-hmac
Response Header Fields Field name Description x-dnsme-requestId A unique identifier of the request that was sent. Use the value of this header to help identify your request for your own purposes or when contacting DNS Made Easy support. x-dnsme-requestLimit Maximum number of requests that can be sent before the rate limit is exceeded. x-dnsmerequestsRemaining Number of requests remaining before the rate limit is exceeded.
Domain
The domain data type contains information about a domain or hosted zone. The following fields are available
/domain Field Name accountId name nameServer gtdEnabled soaID vanityId transferAclId folderId
Type numeric String List of Strings boolean numeric numeric numeric numeric
Description The identifier for the account The domain name. Name servers associated with the domain Indicator of whether or not this domain uses the Global Traffic Director The ID of a custom SOA record The ID of a vanity DNS configuration The ID of a transfer ACL The ID of a domain folder
Example XML Representation: <domain> <name>myDomain.com</name> <nameServer>ns10.dnsmadeeasy.com</nameServer> <nameServer>ns11.dnsmadeeasy.com</nameServer> <nameServer>ns12.dnsmadeeasy.com</nameServer> <nameServer>ns13.dnsmadeeasy.com</nameServer> <nameServer>ns14.dnsmadeeasy.com</nameServer> <nameServer>ns15.dnsmadeeasy.com</nameServer> <gtdEnabled>true</gtdEnabled> </domain> Example JSON Representation: { "name":"myDomain.com", "nameServer":[ "ns10.dnsmadeeasy.com", 8
Example Output:
{"name":"example.com","id":999999,"gtdEnabled":true,"nameServers":[{"i pv4":"208.94.148.4","fqdn":"ns10.dnsmadeeasy.com","ipv6":"2600:1800:10 ::1"},{"ipv4":"208.80.124.4","fqdn":"ns11.dnsmadeeasy.com","ipv6":"260 0:1801:11::1"},{"ipv4":"208.80.126.4","fqdn":"ns12.dnsmadeeasy.com","i pv6":"2600:1802:12::1"},{"ipv4":"208.80.125.4","fqdn":"ns13.dnsmadeeas y.com","ipv6":"2600:1801:13::1"},{"ipv4":"208.80.127.4","fqdn":"ns14.d nsmadeeasy.com","ipv6":"2600:1802:14::1"},{"ipv4":"208.94.149.4","fqdn ":"ns15.dnsmadeeasy.com","ipv6":"2600:1800:15::1"}],"pendingActionId": 0,"folderId":99999,"created":1326758400000,"delegateNameServers":[],"u pdated":1337121058848}
Example Error: Generic API 404 Error for a badly formulated request.
Example Error:
Example Error:
{"error":["Domain name conflicts with existing zones."]}
The domain name exists within a DNS Made Easy Account already.
11
MultiDomain
A collection of domains. This is used to perform an action on any amount of domains at once, such as creation or deletion. In addition to the available fields from Domain, the following fields are also available.
/domains/managed Field Name Type names List of Strings ids List of numbers
Example Output:
12
Example Error:
{"error":["Invalid domain IDs specified.","Invalid Vanity NS configuration."]}
Example Error:
{"error":["Domain name conflicts with existing zones."]}
The domain name exists within a DNS Made Easy Account already.
14
SOA Record
The SOA Record data type contains parameters for custom SOA record configuration. /soa Field Name name id email ttl comp serial refresh retry expire negativeCache
Type String numeric String numeric String numeric numeric numeric numeric Numeric
Description SOA Record name Identifier (system defined) Contact email address TTL of SOA record (in seconds) Primary name server Starting zone serial number Zone refresh time (in seconds) Failed Refresh retry time (in seconds) Expire time of zone (in seconds) Record not found cache (in seconds)
16
Vanity DNS
The Vanity DNS data type contains parameters for vanity DNS configuration. /vanity Field Name name
Type String
id numeric nameServerGroupId numeric public boolean servers default nameServerGroup String boolean String
Description The identifiable name of the Vanity DNS group Identifier (system defined) The name server group the config is assigned True represents a system defined rather than user defined vanity configuration. The vanity host names defined in the config True sets the configuration as the default Lists the DNS Made Easy name servers the configuration is defined for.
Example Output:
{"data":[{"name":"Example Vanity","id":9999,"nameServerGroupId":1,"public":false,"servers":["ns0 .example.com","ns1.example.com"],"default":false,"nameServerGroup":"ns 0,ns1,ns2,ns3,ns4.dnsmadeeasy.com"} ],"totalRecords":1,"totalPages":1,"page":1}
17
Template
The Template data type contains parameters for Record Set Template configuration. /template Field Name name id domainIds publicTemplate
Description Template name Identifier (system defined) Domain IDs currently assigned to the template True represents a system defined public template rather than user defined account specific template.
Template GET
This call would return all templates public and private within the account including. Example Call:
./dnsmeapi.pl https://api.dnsmadeeasy.com/V2.0/dns/template/
Example Output:
{"name":"Example Template","id":9999,"domainIds":[],"publicTemplate":false}
Example Error: Generic API 404 Error for a badly formulated request.
Example Output:
18
Example Error: Generic API 404 Error for a badly formulated request.
Example Output:
{"name":"www","value":"2.2.2.2","id":9999999,"type":"A","ttl":86400,"s ourceId":9999,"failover":false,"monitor":false,"gtdLocation":"DEFAULT" ,"source":2,"dynamicDns":false,"failed":false,"hardLink":false}
Example Error: Generic API 404 Error for a badly formulated request.
19
Account ACL
The Account ACL data type contains parameters for Access Control Lists defined for the account. /transferAcl Field Name name id ips
Description ACL Identifiable name Identifier (system defined) The IP addresses defined in the ACL
Example Output:
{"data":[{"name":"TestACL","id":9999,"ips":["1.2.3.4"]}],"totalRecords ":1,"totalPages":1,"page":1}
20
Folder
The Folder data type contains parameters for managing domain folders defined in the account. /security/folder Field Name Type value numeric label String
Folder GET
Example Call: This call will display a full list of al folders defined in the account.
./dnsmeapi.pl https://api.dnsmadeeasy.com/V2.0/security/folder
Example Output:
[{"value":99999,"label":"Default"},{"value":99991,"label":"Folder1"}]
21
Query Usage
The query usage data type contains information for account query usage. /usageApi/queriesApi/ Field Name id total month year accountId primaryCount primaryTotal secondaryCount secondaryTotal
Type numeric numeric numeric numeric numeric numeric numeric numeric numeric
Description identifier Query total Month Year Account identifier Count of primary domains Query count for primary domains Count of secondary domains Query count for secondary domains
Example XML Representation: <queryUsage> <total>17372</total> <month>12</month> <year>2011<month> <accountId>60630</accountId> </queryUsage> Example JSON Representation:
[{"id":null,"total":1712,"month":9,"year":2011,"day":null,"accountId":99999," primaryCount":0,"primaryTotal":0,"secondaryCount":0,"secondaryTotal":0}, {"id":null,"total":2386,"month":10,"year":2011,"day":null,"accountId":99999," primaryCount":0,"primaryTotal":0,"secondaryCount":0,"secondaryTotal":0}, {"id":null,"total":3444,"month":11,"year":2011,"day":null,"accountId":99999," primaryCount":0,"primaryTotal":0,"secondaryCount":0,"secondaryTotal":0}, {"id":null,"total":17372,"month":12,"year":2011,"day":null,"accountId":99999, "primaryCount":0,"primaryTotal":0,"secondaryCount":0,"secondaryTotal":0}, {"id":null,"total":16481,"month":1,"year":2012,"day":null,"accountId":99999," primaryCount":0,"primaryTotal":0,"secondaryCount":0,"secondaryTotal":0}]
22
23
Failover
The Template data type contains parameters for Record Set Template configuration. /monitor Field Name Type monitor boolean systemDescription String maxEmails sensitivity numeric numeric
Description True indicates System Monitoring Enabled The system description configured for the failover event notification. The number of emails sent to the contact for an outage. The number of checks placed against the primary IP before a Failover event occurs. List of Sensitivity IDs: Low (slower failover) = 8 Medium = 5 High = 3 The protocol for DNS Failover to monitor on. List of Protocol IDs: TCP = 1 UDP = 2 HTTP = 3 DNS = 4 SMTP = 5 HTTPS = 6 The port for DNS Failover to monitor on the specified protocol. True indicates DNS Failover Enabled True indicates the failback to the primary IP address is a manual process. False indicates the failback to the primary IP is an automatic process. The primary IP address The secondary IP address The tertiary IP address The quaternary IP address
24
protocolId
numeric
ip5
numeric
25
Record
The record data type contains information about a record for a given domain. The following fields are available:
hardlink
Boolean
Description Unique record identifier Record name. Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT HTTPRED: <redirection URL> MX: <priority> <target name> NS: <name server> PTR: <target name> SRV: <priority> <weight> <port> <target name> TXT: <text value> Time to live. The amount of time a record will be cached before being refreshed. Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE For A records. Password used to authenticate for dynamic DNS. For HTTPRED records. A description of the HTTPRED record. For HTTPRED records. Keywords associated with the HTTPRED record. For HTTPRED records. The title of the HTTPRED record. For HTTPRED records. Type of redirection performed. Values: Hidden Frame Masked, Standard 302, Standard 301 For HTTPRED records
26
Example XML Representation: <record> <data>208.94.147.96</data> <gtdLocation>Default</gtdLocation> <id>123456</id> <name>dummy</name> <ttl>1800</ttl> <type>A</type> </record> <record> <data>mail.myDomain.com.</data> <gtdLocation>Default</gtdLocation> <id>123456</id> <name>dummy2</name> <ttl>1800</ttl> <type>MX</type> </record> Example JSON Representations: { "name":"dummy", "id":123456, "type":"A", "data":"208.94.147.96", "gtdLocation":"Default", "ttl":1800 } { "name":"dummy2", "id":123456, "type":"MX", "data":"10 mail.myDomain.com.", "gtdLocation":"Default", "ttl":1800 }
Example Output:
{"data":[{"name":"mail","value":"www","id":9999999,"type":"CNAME","ttl ":1800,"sourceId":999999,"failover":false,"monitor":false,"gtdLocation ":"DEFAULT","source":1,"dynamicDns":false,"failed":false,"hardLink":fa lse},{"name":"google","value":"http://www.google.com/","id":9999991,"t ype":"HTTPRED","ttl":1800,"sourceId":999999,"failover":false,"monitor" :false,"title":"title","gtdLocation":"DEFAULT","redirectType":"Standar d 302","keywords":"keywords","description":"description","source":1,"dyn amicDns":false,"failed":false,"hardLink":false},{"name":"www","value": "5.5.5.5","id":9999992,"type":"A","ttl":1800,"sourceId":999999,"failov er":false,"monitor":false,"gtdLocation":"EUROPE","source":1,"dynamicDn s":false,"failed":false,"hardLink":false}],"page":1,"totalPages":1,"to talRecords":3}
Example Error: Generic API 404 Error for a badly formulated request.
28
Example Output:
{"name":"test","value":"1.1.1.1","id":9999993,"type":"A","ttl":86400," sourceId":999999,"failover":false,"monitor":false,"gtdLocation":"DEFAU LT","source":1,"dynamicDns":false,"failed":false,"hardLink":false}
Example Error:
{"error":["Record with this type (A), name (test), and value (1.1.1.1) already exists."]}
29
30
/dns/managed/{domainId}/records operate on multiple records for one domain Method HTTP Status Codes Description GET 200 OK Returns the record object representation of the records for the specified domain. The following are URL parameters that may be added to determine the data returned: type Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT rows Number of rows returns page The page number of records, based on the number of rows returned DELETE 200 OK Deletes the specified records using a list of record identifiers provided in XML or JSON format for the given template. WARNING: This is irreversible! POST 200 OK Creates a series of records for the given domain using the list of record information provided in XML or JSON format
/dns/managed/{templateId}/records operate on multiple records for one template Method HTTP Status Codes Description GET 200 OK Returns record object representations of the records for the specified template. The following are URL parameters that may be added to determine the data returned: type Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT rows Number of rows returned page The page number of records, based on the number of rows returned DELETE 200 OK Deletes the specified records using a list of 404 specified domain record identifiers provided in XML or JSON name is not found format for the given template.
31
PUT
200 - OK
POST
200 OK
WARNING: This is irreversible and affects the records for any domain associated with the given template! Replaces the current set of records for a template using the provided list of records provided in XML or JSON format for the given template. WARNING: This is irreversible and affects the records for any domain associated with the given template! Creates a record for the given template using the record information provided in XML or JSON format
/dns/secondary operate on multiple secondary domains for your account Method HTTP Status Codes Description GET 200 OK Returns a list of all domain names for your account. DELETE 200 OK Deletes all domains for your account PUT 200 OK Updates multiple domains based on the identifiers in the ids field. The following values can be updated for all domains provided in the list: Global Traffic Director Applied Template Vanity NS Config Custom SOA Record Zone Transfer Folder POST 200 OK Creates multiple domains based on a list of names provided within a MultiDomain object.
32
/dns/secondary/{domainId} operate on a single secondary domain Method HTTP Status Codes Description GET 200 OK Returns the domain object representation of the specified domain. DELETE 200 OK Deletes the specified domain 404 specified domain WARNING: This is irreversible! name is not found PUT 200 OK Updates a domains based on the domainId identifier in the path. Pass in a Domain object in XML or JSON with the new values.
/dns/secondary/{domainId}/records operate on multiple records for one secondary domain Method HTTP Status Codes Description GET 200 OK Returns the record object representation of the records for the specified domain. The following are URL parameters that may be added to determine the data returned: type Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT rows Number of rows returns page The page number of records, based on the number of rows returned DELETE 200 OK Deletes the specified records using a list of record identifiers provided in XML or JSON format for the given template. WARNING: This is irreversible! POST 200 OK Creates a series of records for the given domain using the list of record information provided in XML or JSON format
33
/dns/managed/{templateId}/records operate on multiple records for one template Method HTTP Status Codes Description GET 200 OK Returns record object representations of the records for the specified template. The following are URL parameters that may be added to determine the data returned: type Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT rows Number of rows returned page The page number of records, based on the number of rows returned DELETE 200 OK Deletes the specified records using a list of 404 specified domain record identifiers provided in XML or JSON name is not found format for the given template. WARNING: This is irreversible and affects the records for any domain associated with the given template! PUT 200 - OK Replaces the current set of records for a template using the provided list of records provided in XML or JSON format for the given template. WARNING: This is irreversible and affects the records for any domain associated with the given template! POST 200 OK Creates a record for the given template using the record information provided in XML or JSON format
34
/dns/managed/{templateId}/records/{recordId} operate on one record for one template Method HTTP Status Codes Description DELETE 200 OK Deletes the specified record for the given 404 specified domain template. name is not found WARNING: This is irreversible and affects the records for any domain associated with the given template! PUT 200 OK Updates a record for the given template using the record information provided in XML or JSON format
/usageApi/queriesApi get account usage information by year and month Method HTTP Status Codes Description GET 200 OK Returns a list of QueryUsage objects. /usageApi/queriesApi/{year}/{month} get account usage information for a given year and month Method HTTP Status Codes Description GET 200 OK Returns a list of QueryUsage objects. /usageApi/queriesApi/{year}/{month}/managed/{domainId} get usage information for a given year and month for one domain Method HTTP Status Codes Description GET 200 OK Returns a list of QueryUsage objects.
/usageApi/queriesApi/{year}/{month}/secondary/{domainId} get usage information for a given year and month for one secondary domain Method HTTP Status Codes Description GET 200 OK Returns a list of QueryUsage objects.
35
Error Reporting
Generic Bad API Request Error
This is a generic error response code which indicates an error in the request issued, typically formatting or syntax related.
<html><head><title>Apache Tomcat/7.0.12 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sansserif;color:white;background-color:#525D76;font-size:22px;} H2 {fontfamily:Tahoma,Arial,sans-serif;color:white;backgroundcolor:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sansserif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;backgroundcolor:white;} B {font-family:Tahoma,Arial,sansserif;color:white;background-color:#525D76;} P {fontfamily:Tahoma,Arial,sans-serif;background:white;color:black;fontsize:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Not Found</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Not Found</u></p><p><b>description</b> <u>The requested resource (Not Found) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.12</h3></body></html>
36