Greetings,
We're working very hard here to improve upon and enhance the technology we
offer to all our Resellers. With that in mind, there's been some proposed
changes to the API as it stands to reflect further advancements of the SRS
system(s). Please note that this change will NOT affect current systems
and their workings, but rather provide a go forward basis for continued
development. Following is some notes and pieces put together by some
developers here at Tucows. We welcome your comments, suggestions, and
concerns.
While change is sometimes viewed as a troublesome and painful process, in
this case it will be done with ease - and out of necessity. This new API
will provide extra functionality to be offered by the next release of
OpenSRS. This includes registration of TLDs outside the scope of the
usual NSI trio of com, net and org. In offering more TLDs, you'll be
able to increase your customer base. Additionally, this API will have a
real spec written for people to follow that wish to create their own
interface in whatever language they desire.
Here are some sample changes to the client API for the next slated
release. The send_cmd() method of the Client.pm package used to take two
parameters: string indicating the action, and a Perl hash which contained
the data required for the action. Now send_cmd() only takes one
parameter: a reference to a Perl hash. The returned data has also
changed. Previous, send_cmd() would return a hash of data, now it returns
a reference to a hash. The three ever-present keys, "_is_success",
"_response_code" and "_response_text" no longer have underscores that
start their names (so they are now "is_success", "response_code", and
"response_text").
The old "update_nameservers":
$response = $Client->send_cmd(
"update_nameservers",
(
cookie => "123456789:998877",
fqdn1 => "ns1.domain.com",
fqdn2 => "ns2.domain.com",
)
);
The new "modify domain" for nameservers:
$response = $Client->cmd(
{
action => "modify",
object => "domain",
cookie => "123456789:998877",
attributes => {
data => "nameserver_list",
nameserver_list => [
{ name => "ns1.domain.com", sortorder => 1,
action => "update" },
{ name => "ns2.domain.com", sortorder => 2,
action => "update" }
]
}
}
);
The old "modify_contact_info":
$response = $Client->send_cmd(
"modify_contact_info",
(
cookie => "123456789:998877",
type => "admin",
first_name => "John",
last_name => "Smith",
address1 => "101 Street Ave.",
address2 => "Suite 1",
address3 => "Cube 250",
city => "Toronto",
state => "Ontario",
postal_code => "Z1Z 1Z1",
country => "CA",
phone => "416-555-0123",
fax => "416-555-0123",
url => undef,
email => "[EMAIL PROTECTED]",
org_name => "People Doing Great Things",
affect_billing => 0,
affect_tech => 1,
affect_owner => 0,
)
);
This is the new "modify domain" for contact info:
$response = $Client->send_cmd(
{
action => "modify",
object => "domain",
cookie => "123456789:998877",
attributes => {
data => "contact_info",
contact_set => {
admin => {
first_name => "John",
last_name => "Smith",
address1 => "101 Street Ave.",
address2 => "Suite 1",
address3 => "cube 250",
city => "Toronto",
state => "Ontario",
postal_code => "z1z1z1",
country => "CA",
phone => "416-555-0123",
fax => "416-555-0124",
url => undef,
email =>
"[EMAIL PROTECTED]",
org_name => "People Doing
Great Things",
},
also_apply_to => [
"billing",
"tech",
"owner",
]
}
}
}
);
Data returned on "gets" has also changed. Here's a sample
request/response the gets the nameservers assigned to the user's domain.
$response = $Client->cmd(
{
action => "get",
object => "domain",
cookie => $cookie,
attributes => {
type => "nameservers"
}
}
)
Response is a hash reference:
{
action => "REPLY"
object => "GET",
is_success => 1,
response_code => 200,
response_text => "Query Successful",
attributes => {
type => "nameservers",
nameserver_list => [
{ name => "ns1.domain.com", ipaddress =>
"101.102.103.104", sortorder => 1 },
{ name => "ns2.domain.com", ipaddress => "10.12.13.14",
sortorder => 2 }
]
}
}
--
Charles Daminato
OpenSRS Support Manager
[EMAIL PROTECTED]