initworks/openprovider-php

There is no license information available for the latest version (v1.0.0) of this package.

PHP interface to OpenProvider API

v1.0.0 2015-12-14 16:18 UTC

This package is not auto-updated.

Last update: 2024-04-10 21:53:35 UTC


README

This package contains a small PHP interface to make use of the OpenProvider API (https://doc.openprovider.eu/index.php/Main_Page).

NOTE: It's very important to remember that this version is NOT identical to the API listed above. This version is compliant to PSR-2 and PSR-4, and is therefore namespaced accordingly.

Be watchful when following the API docs

Example

require 'vendor/autoload.php';

use OpenProvider\API;
use OpenProvider\Request;

$api = new API('https://api.openprovider.eu');

$request = new Request();
$request
    ->setCommand('checkDomainRequest')
    ->setAuth([ 'username' => '[username]', 'password' => '[password]' ])
    ->setArgs([
        'domains' => [
            [
                'name' => 'openprovider',
                'extension' => 'nl',
            ],
            [
                'name' => 'jouwweb',
                'extension' => 'nl'
            ],
        )
    ]);

$reply = $api->setDebug(1)->process($request);
echo "Code: " . $reply->getFaultCode() . "\n";
echo "Error: " . $reply->getFaultString() . "\n";
echo "Value: " . print_r($reply->getValue(), true) . "\n";
echo "\n---------------------------------------\n";

echo "Finished example script\n\n";