Difference between revisions of "Get Domain Info"
From Boxis.net API Docs
(→Example in XML (Success)) |
(→Example URL with POST values) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 24: | Line 24: | ||
<pre> | <pre> | ||
− | + | http://api.boxis.net/ | |
POST: version=1.0&returntype=xml×tamp=1337854044&username=your@mail.com&authcode=1234567890§ion=domains&action=getDomain&domain=test1.com | POST: version=1.0&returntype=xml×tamp=1337854044&username=your@mail.com&authcode=1234567890§ion=domains&action=getDomain&domain=test1.com | ||
</pre> | </pre> | ||
− | |||
== Output params == | == Output params == | ||
Line 201: | Line 200: | ||
/* PROCESS THE ACTION */ | /* PROCESS THE ACTION */ | ||
$boxisAPI = new BoxisAPIConnection($email, $apikey); | $boxisAPI = new BoxisAPIConnection($email, $apikey); | ||
− | $return = $boxisAPI->call($apitype, $command, $params); | + | $return = $boxisAPI->call($apitype, $command, $params, $timestamp); |
+ | |||
+ | /* TIMESTAMP SYNCHRONIZATION (JSON EXAMPLE) | ||
+ | if($return['timestamperror']) { | ||
+ | $timestamp = $return['timestamp']; | ||
+ | $return = $boxisAPI->call($apitype, $command, $params, 'json', $timestamp); | ||
+ | } | ||
+ | */ | ||
+ | |||
+ | /* TIMESTAMP SYNCHRONIZATION (XML EXAMPLE)*/ | ||
+ | /* | ||
+ | if($return->timestamperror) { | ||
+ | $timestamp = $return->timestamp; | ||
+ | $return = $boxisAPI->call($apitype, $command, $params, 'xml', $timestamp); | ||
+ | } | ||
+ | /* | ||
+ | |||
</pre> | </pre> |
Latest revision as of 13:55, 26 October 2012
Contents
Domain Function: getDomain
With this command, you are able to viewing the domain details.
Input params
- version::String - API version (e.g. '1.0')
- timestamp::String - Sequence of characters, denoting the date and time (e.g '1336553826')
- username::String - User e-mail address (e.g 'mail1@example.com')
- authcode::String - md5 hash consisting of the concatenation of timestamp and user_key (e.g md5(1336553826BX3KwWU2SuqvoEWnjYmOibf'))
- section::String - API module name. Use 'domains' value
- action::String - API module function. Use 'getDomain' value
- domain::String - Domain name that you need to register
Example URL with POST values
http://api.boxis.net/ POST: version=1.0&returntype=xml×tamp=1337854044&username=your@mail.com&authcode=1234567890§ion=domains&action=getDomain&domain=test1.com
Output params
Example in XML (Success)
<?xml version="1.0" encoding="UTF-8"?> <return> <result>1</result> <resulttxt></resulttxt> <params> <details> <domain>test1.com</domain> <order_id>654</order_id> <payment_module>130</payment_module> <date_created>1970-01-01</date_created> <firstpayment>17.68</firstpayment> <recurring_amount>17.68</recurring_amount> <years>2</years> <expires>1970-01-01</expires> <type>Register</type> <status>Pending</status> <next_due>1970-01-01</next_due> <next_invoice>1969-12-25</next_invoice> <protect-privacy>1</protect-privacy> <nameservers> <ns1>ns1.boxis.ch</ns1> <ns2>ns1.boxis.ch</ns2> <ns3>ns3.boxis.ch</ns3> <ns4>ns4.boxis.ch</ns4> <ns5>ns5.boxis.ch</ns5> </nameservers> <autorenew>1</autorenew> <protection-lock>0</protection-lock> <auth-code></auth-code> <notes></notes> <extended></extended> <lastname>Keck</lastname> <firsname>Konrad</firsname> <contacts> <registrant> <firstname>John</firstname> <lastname>Doe</lastname> <companyname>company1</companyname> <email>mail1@mail.com</email> <address1>baker street 5</address1> <address2></address2> <city>NY</city> <state>NY</state> <postcode>1207</postcode> <country>USA</country> <phonenumber>48156113563</phonenumber> </registrant> <tech> <firstname>Phil</firstname> <lastname>Doe</lastname> <companyname>company1</companyname> <email>mail2@mail.com</email> <address1>baker street 6</address1> <address2></address2> <city>NY</city> <state>NY</state> <postcode>1207</postcode> <country>USA</country> <phonenumber>48156611663</phonenumber> </tech> <admin> <firstname>George</firstname> <lastname>Doe</lastname> <companyname>company3</companyname> <email>mail3@mail.com</email> <address1>Av. Pictet-de-Rochemont 29</address1> <address2></address2> <city>Geneva</city> <state>CH</state> <postcode>1207</postcode> <country>CH</country> <phonenumber>+41.0041227359740</phonenumber> </admin> <billing> <firstname>George</firstname> <lastname>Doe</lastname> <companyname>company3</companyname> <email>mail3@mail.com</email> <address1>Av. Pictet-de-Rochemont 29</address1> <address2></address2> <city>Geneva</city> <state>CH</state> <postcode>1207</postcode> <country>CH</country> <phonenumber>+41.0041227359740</phonenumber> </billing> </contacts> </details> </params> <timestamp>1335781349</timestamp> </return>
Example in XML (Error)
<?xml version="1.0" encoding="UTF-8"?> <return> <result>0</result> <resulttxt>Error: {error description}</resulttxt> <params/> <timestamp>1335767184</timestamp> </return>
Example in JSON (Success)
{"result":"1", "resulttxt":null, "params":{ "details":{ "domain":"test1.com", "order_id":"654", "payment_module":"130", "date_created":"1970-01-01", "firstpayment":"17.68", "recurring_amount":"17.68", "years":"2","expires":"1970-01-01", "type":"Register", "status":"Pending", "next_due":"1970-01-01", "next_invoice":"1969-12-25", "protect-privacy":"1", "nameservers{ "ns1":"ns1.boxis.ch", "ns2":"ns1.boxis.ch", "ns3":"ns3.boxis.ch", "ns4":"ns4.boxis.ch", "ns5":"ns5.boxis.ch"}, "autorenew":"1", "protection-lock":"0", "auth-code":"", "notes":"", "extended":"", "lastname":"Keck", "firsname":"Konrad"} }, "timestamp":1335781465}
Example in JSON (Error)
{"result":"0", "resulttxt":"Error: {error description}", "params":[],"timestamp":1335777400}
Example using our PHP Class
/* API LOGIN DETAILS */ $email = 'your@mail.com'; // your username $apikey = '1234567890'; // your apikey /* API COMMAND DETAILS */ $apitype = 'domains'; $command = 'getDomain'; $params = array( 'returntype' => 'xml', 'domain' => 'test1.com', ); /* PROCESS THE ACTION */ $boxisAPI = new BoxisAPIConnection($email, $apikey); $return = $boxisAPI->call($apitype, $command, $params, $timestamp); /* TIMESTAMP SYNCHRONIZATION (JSON EXAMPLE) if($return['timestamperror']) { $timestamp = $return['timestamp']; $return = $boxisAPI->call($apitype, $command, $params, 'json', $timestamp); } */ /* TIMESTAMP SYNCHRONIZATION (XML EXAMPLE)*/ /* if($return->timestamperror) { $timestamp = $return->timestamp; $return = $boxisAPI->call($apitype, $command, $params, 'xml', $timestamp); } /*