Skip to content
Miky edited this page Sep 10, 2015 · 5 revisions

The DonDominio API Client for PHP is the easiest way to use the DonDominio API within your PHP application.

Before you start

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.

Installation

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'
));

Basic usage

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.

Advanced usage

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.

Examples

The Examples section of the Wiki has a few examples to get started.

Documentation

The DonDominioPHP Wiki covers the usage of every part of the Client:

There's also documentation for each module wrapper:

Clone this wiki locally