Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Alan Graham
Last updated July 9, 2006
Overview
This is preliminary documentation and is subject to change. Please send all feedback to
support@nettica.com.
Nettica Bulk Services API allows you to manage your DNS services programmatically using simple SOAP
interfaces. This document will detail how to issue requests both using C# and directly using the XML.
• CreateZone
• DeleteZone
• ListZones
• ListDomain
• AddRecord
• DeleteRecord
• UpdateRecord
• GetServiceInfo
Result Codes
Result Code Description
200 Success
401 Access Denied
404 Not Found
430 Domain Exists
450 No Service
451 No credits
460 Your service has expired
Notes
Specifying the IP address of the root record of the domain is no longer required and is ignored. You should
be sure to create a root “A” record for the domain after creating the zone.
C# Example
com.nettica.www.DnsApi api = new com.nettica.www.DnsApi();
com.nettica.www.DnsResult result = api.CreateZone( "debug", "ZGVidWc=", "test-
it.com", "");
switch (result.Status)
{
case 200:
// success
break;
default:
// Error cases
break;
}
XML Example
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
DomainName String Fully qualified domain name
Result Codes
Result Code Description
200 Success
401 Access Denied
404 Not Found
431 Domain does not exist
450 No Service
451 No credits
460 Your service has expired
Notes
C# Example
com.nettica.www.DnsApi api = new com.nettica.www.DnsApi();
com.nettica.www.DnsResult result = api.DeleteZone( "debug", "ZGVidWc=", "test-
it.com");
switch (result.Status)
{
case 200:
// success
break;
default:
// Error cases
break;
}
XML Example
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
Result Codes
Result Code Description
200 Success
401 Access Denied
404 Not Found
450 No Service
460 Your service has expired
ZoneResult
public class ZoneResult
{
public DnsResult Result;
public int Count;
public string [] Zone;
}
Notes
ListZones will return a ZoneResult structure containing the overall status of the request, the Count of
returned zones, and an array of zones in the account.
C# Example
com.nettica.www.ZoneResult zones = api.ListZones( "debug", "ZGVidWc=");
for (int i=0; i<zones.Count; i++)
{
Debug.WriteLine( zones.Zone[i] );
}
XML Example
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
DomainName String
Result Codes
Result Code Description
200 Success
401 Access Denied
404 Not Found
450 No Service
460 Your service has expired
DomainResult
public class DomainResult
{
public DnsResult Result = new DnsResult();
public int Count;
public DomainRecord [] Record;
}
Notes
ListZones will return a ZoneResult structure containing the overall status of the request, the count of records
for the domain, and an entry for each record returned.
C# Example
com.nettica.www.DomainResult domain = api.ListDomain( "debug", "ZGVidWc=",
"test-it.com");
for (int i=0; i< domain.Count; i++)
{
Debug.Write( domain.Record[i].DomainName );
Debug.Write( domain.Record[i].HostName );
Debug.Write( domain.Record[i].Data );
Debug.Write( domain.Record[i].RecordType );
Nettica Corporation Confidential 8
Debug.Write( domain.Record[i].TTL );
}
XML Example
POST /DNS/DnsApi.asmx HTTP/1.1
Host: www.nettica.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.nettica.com/DNS/DnsApi/ListDomain"
AddRecord
AddRecord adds a resource record to a domain.
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
Record DomainRecord
Result Codes
Result Code Description
200 Success
401 Access Denied
404 Not Found
431 Record already exists
432 Invalid record type. Must be “A”, “MX”, “CNAME”, “F”, “”TXT”, or “SRV”
450 No Service
460 Your service has expired
DomainRecord
public class DomainRecord
{
public string DomainName;
public string HostName;
public string RecordType;
public string Data;
public int TTL;
public int Priority;
}
DnsResult
public class DnsResult
{
public int Status;
public string Description;
}
Notes
TTL Description
0 Take the TTL from the SOA record
1 Dynamic (60 seconds)
60 60 seconds
300 5 minutes
600 10 minutes
900 15 minutes
1800 30 minutes
2700 45 minutes
3600 1 hour
7200 2 hours
14400 4 hours
28800 8 hours
43200 12 hours
64800 18 hours
86400 1 day
172800 2 days
For forwarding records, a priority of 1 indicates a straight forward, 2 specifies “masking” (putting the request
inside a frame). The default value is 1.
C# Example
com.nettica.www.DomainRecord d = new com.nettica.www.DomainRecord();
d.DomainName = "test-it.com";
d.HostName = "@";
d.RecordType = "A";
d.TTL = 0; // default (static)
d.Data = "1.2.3.4";
XML Example
POST /DNS/DnsApi.asmx HTTP/1.1
Host: www.nettica.com
Content-Type: text/xml; charset=utf-8
Nettica Corporation Confidential 11
Content-Length: length
SOAPAction: "http://www.nettica.com/DNS/DnsApi/AddRecord"
DeleteRecord
DeleteRecord removes a resource record from a domain.
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
Record DomainRecord
Result Codes
Result Code Description
200 Success
Nettica Corporation Confidential 12
401 Access Denied
404 Not Found
431 Record already exists
432 Invalid record type. Must be “A”, “MX”, or “CNAME”.
450 No Service
460 Your service has expired
DomainRecord
public class DomainRecord
{
public string DomainName;
public string HostName;
public string RecordType;
public string Data;
public int TTL;
public int Priority;
}
DnsResult
public class DnsResult
{
public int Status;
public string Description;
}
Notes
The required fields in DomainRecord that must match in order to delete the record are DomainName,
HostName, RecordType, and Data. All other fields are ignored but may be specified.
Important: Deleting the root record will make the domain inaccessible via this API in Beta.
C# Example
com.nettica.www.DomainRecord d = new com.nettica.www.DomainRecord();
d.DomainName = "test-it.com";
d.HostName = "@";
d.RecordType = "A";
d.TTL = 0; // default (static)
d.Data = "1.2.3.4";
XML Example
POST /DNS/DnsApi.asmx HTTP/1.1
Host: www.nettica.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
Nettica Corporation Confidential 13
SOAPAction: "http://www.nettica.com/DNS/DnsApi/DeleteRecord"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<DeleteRecord xmlns="http://www.nettica.com/DNS/DnsApi">
<UserName>string</UserName>
<Password>string</Password>
<d>
<DomainName>string</DomainName>
<HostName>string</HostName>
<RecordType>string</RecordType>
<Data>string</Data>
<TTL>int</TTL>
<Priority>int</Priority>
</d>
</DeleteRecord>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
UpdateRecord
UpdateRecord removes the old record and replaces it with the new record for a domain.
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
OldRecord DomainRecord
NewRecord DomainRecord
Result Codes
Result Code Description
Nettica Corporation Confidential 14
200 Success
401 Access Denied
404 Not Found
431 Record already exists
432 Invalid record type. Must be “A”, “MX”, or “CNAME”.
450 No Service
460 Your service has expired
DomainRecord
public class DomainRecord
{
public string DomainName;
public string HostName;
public string RecordType;
public string Data;
public int TTL;
public int Priority;
}
DnsResult
public class DnsResult
{
public int Status;
public string Description;
}
Notes
This API is safe to use to update the root record.
C# Example
com.nettica.www.DomainRecord o = new com.nettica.www.DomainRecord();
d.DomainName = "test-it.com";
d.HostName = "@";
d.RecordType = "A";
d.TTL = 0; // default (static)
d.Data = "1.2.3.4";
Parameters
Parameter Type Notes
UserName String
Password String Base64 encoded
Result Codes
Result Code Description
200 Success
401 Access Denied
404 Not Found
ServiceResult
public class ServiceResult
{
public DnsResult Result = new DnsResult();
public int RemainingCredits;
public int TotalCredits;
public DateTime ServiceRenewalDate;
}
Notes
GetServiceInfo will return information in the service result (remaining credits, etc) despite expired service
and no credits return codes. It will not return information on other error codes.
C# Example
com.nettica.www.ServiceResult serviceResult = api.GetServiceInfo( "debug", "ZGVidWc=" );
XML Example
POST /DNS/DnsApi.asmx HTTP/1.1
Host: www.nettica.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.nettica.com/DNS/DnsApi/GetServiceInfo"