-
Notifications
You must be signed in to change notification settings - Fork 3
Home
The DonDominio API Client for PHP is the easiest way to use the DonDominio API within your PHP application.
To use the DonDominio API, you will need first to sign up for an API username & key. More information about the DonDominio API is available on the Developer Portal.
To use the client, download the source code, unzip it and place it within your application. Then,
include the DonDominio.php class and start using it right away:
require_once('path/to/DonDominioAPI.php');
$client = new DonDominioAPI(array(
'apiuser' => '00000-XXX',
'apipasswd' => 'XXXXXXXXXXXX'
));This is the recommended usage. The DonDominio Client provides wrappers for each module in the DonDominio API.
For example, to get your account information:
$dondominio = new DonDominioAPI(array(
'apiuser' => '00000-XXX',
'apipasswd' => 'XXXXXXXXXXXX'
));
$response = $dondominio->account_info();
print_r($response->getResponseData());getResponseData() returns an array containing the result of the API call. The
DonDominioResponse object documentation
describes all available methods and formats.
The DonDominio Client allows you to call the API directly:
$dondominio = new DonDominioAPI(array(
'apiuser' => '00000-XXX',
'apipasswd' => 'XXXXXXXXXXXX'
));
$data = $dondominio->call('account/info/', array());
$response = json_decode($data, true);
print_r($response['responseData']);Note that you'll need to do all the validations and conversions by yourself. The DonDominio Client documentation covers this method as well.
The Examples section of the Wiki has a few examples to get started.
The DonDominioPHP Wiki covers the usage of every part of the Client:
There's also documentation for each module wrapper: