Difference between revisions of "PHP Integration Sample"
From Boxis.net API Docs
Line 6: | Line 6: | ||
[http://www.boxis.net/xmlapi/examples/getFile.php Download Class] | [http://www.boxis.net/xmlapi/examples/getFile.php Download Class] | ||
− | === Example | + | === Example 1 - Domains API === |
This is simple example how to use our API with the class.boxisAPI.php | This is simple example how to use our API with the class.boxisAPI.php | ||
Line 35: | Line 35: | ||
=== Example 2 - SMS API === | === Example 2 - SMS API === | ||
+ | |||
+ | === Example 1 - Domains API === | ||
+ | |||
+ | This is simple example how to use our API with the class.boxisAPI.php | ||
+ | |||
+ | <pre> | ||
+ | /* API LOGIN DETAILS */ | ||
+ | /* API LOGIN DETAILS */ | ||
+ | $email = 'your@email.com'; // your username | ||
+ | $apikey = '1234567890'; // your apikey | ||
+ | |||
+ | /* API COMMAND DETAILS */ | ||
+ | $apitype = 'sms'; | ||
+ | $command = 'sendSMS'; | ||
+ | $params = array( | ||
+ | 'returntype' => 'json', // json or xml | ||
+ | 'sender_name' => 'boxis.net', | ||
+ | 'recipients' => array('48599131568'), | ||
+ | 'content' => 'test1', | ||
+ | ); | ||
+ | |||
+ | /* PROCESS THE ACTION */ | ||
+ | $boxisAPI = new BoxisAPIConnection($email, $apikey); | ||
+ | $return = $boxisAPI->call($apitype, $command, $params); | ||
+ | |||
+ | /* RETURNED VALUE */ | ||
+ | print_r($return); | ||
+ | </pre> |
Revision as of 11:31, 25 May 2012
Contents
PHP Integration Sample
Boxis.net API is simple to implement using any programming language available that can communicate remotely to our system. We have created simple communication class for the PHP. Yet, you can create your own based on the one we have provided.
Example 1 - Domains API
This is simple example how to use our API with the class.boxisAPI.php
/* API LOGIN DETAILS */ $email = 'your@email.com'; // your username $apikey = '1234567890'; // your apikey /* API COMMAND DETAILS */ $apitype = 'domains'; $command = 'register'; $params = array( 'returntype' => 'xml', // xml or json 'domain' => 'test1.com', 'years' => 2, 'ns' => array('203.234.12.34', '88.23.23.44'), 'protect-privacy' => 1 ); /* PROCESS THE ACTION */ $boxisAPI = new BoxisAPIConnection($email, $apikey); $return = $boxisAPI->call($apitype, $command, $params); /* RETURNED VALUE */ print_r($return);
Example 2 - SMS API
Example 1 - Domains API
This is simple example how to use our API with the class.boxisAPI.php
/* API LOGIN DETAILS */ /* API LOGIN DETAILS */ $email = 'your@email.com'; // your username $apikey = '1234567890'; // your apikey /* API COMMAND DETAILS */ $apitype = 'sms'; $command = 'sendSMS'; $params = array( 'returntype' => 'json', // json or xml 'sender_name' => 'boxis.net', 'recipients' => array('48599131568'), 'content' => 'test1', ); /* PROCESS THE ACTION */ $boxisAPI = new BoxisAPIConnection($email, $apikey); $return = $boxisAPI->call($apitype, $command, $params); /* RETURNED VALUE */ print_r($return);