Accessing the Inventory API with PHP

Customers using PHP will need to do the following steps in order to call the Inventory API’s services (its functions).
 
General Information
 
  • The Inventory API uses SOAP to communicate.
 
Set Up Steps to Use the API Services (the functions)
 
  1. Reference the following: http://api.reliablesite.net/inventory.svc?wsdl to review the function calls of the API service.
  2. The WSDL file has been converted into classes (via wsdltophp.com) for ease of use and can be downloaded at http://api.reliablesite.net/inventory-php.zip.
  3. Unzip the file into your programming directory and use the "sample-inventory_.php" file for examples of calling each function within the API.
 
Demonstration on How to Code a Call to an API Function
 
Calling the “Inventory Management” service's “list servers” functionality.
 
Function to be called along with the required parameters:
     ServersList()
 
The function results and user object (the server details) are passed back to the calling client.
 
<?php

ini_set('memory_limit','512M');
ini_set('display_errors',true);
error_reporting(-1);

require_once dirname(__FILE__) . '/Inventory_Autoload.php';

$inventory = new InventoryServiceServers();
if ($inventory->ServersList()) {
    print_r($inventroy_Inventory->getResult());
else
    print_r($inventroy_Inventory->getLastError());
?>
 
 

Add Feedback