The better TransIP SOAP client. Object Oriented and well documented. PHP5.6+
This library is an Object Oriented wrapper for the TransIP SOAP API (v5.6), which aims to provide a better and more structured client than the official TransIP API package, including extensive documentation.
To use this library without running in to trouble you will need PHP 5.6+ or HHVM 3.6+ and Composer.
Get the latest version of TransIP by adding the following line to your composer.json
file
"hiddeco/transip": "5.7.*"
Run composer update
or composer install
Client
Client
// Composer autoload
require_once 'vendor/autoload.php';
$client = new \TransIP\Client('username', 'privateKey');
$domainNames = $client->api('domain')->getDomainNames();
Although the permission mode and endpoint are configured by default as readonly
and api.transip.nl
, it is possible to
change them according to your wishes.
Note: accepted permission modes are readonly
and readwrite
. Invalid permission mode will throw an \InvalidArgumentException
.
$client = new \TransIP\Client('username', 'privateKey', 'readwrite', 'api.transip.nl');
// set permission mode on the run
try {
$client->setMode('readonly');
} catch(\InvalidArgumentException $e) {
echo $e->getMessage();
}
\SoapFault
$client = new \TransIP\Client('username', 'privateKey');
try {
$client->api('domain')->getDomainNames();
} catch(\SoapFault $e) {
$echo $e->getMessage();
}
For a full documentation on the available methods foreach API and how to use them take a look at the extensive docs.
TransIP is licensed under The MIT License (MIT).