This documentation has moved

XML API documentation can now be found at developer.openprovider.com. This page will remain available until September 2026, but will no longer be updated.

The XML API itself is not changing. Your existing integration continues to work.

Example Script PHP

From Openprovider API documentation

Revision as of 12:48, 16 October 2013 by WikiSysop (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search
<?php

  echo "Started example script\n\n";

  require_once('API.php');

  $username = "";
  $password = "";

  // Create a new API connection
  $api = new OP_API ('https://api.openprovider.eu');

  $request = new OP_Request;
  $request->setCommand('checkDomainRequest')
    ->setAuth(array('username' => $username, 'password' => $password))
    ->setArgs(array(
      'domains' => array(
          array('name' => 'openprovider', 'extension' => 'nl'),
          array('name' => 'non-existing-domain', 'extension' => 'co.uk')
        )
      )
    );
  $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";

?>
Views
Personal tools