gohrco/whmcsapi

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

API interface handler for WHMCS v6.0 and above

v1.0.0 2016-04-25 20:29 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:24:59 UTC


README

Synopsis

API interface handler for WHMCS v6.0 and above

Installation

Install the latest version with

$ composer require gohrco/whmcsapi

Basic Usage

<?php

use Gohrco\Whmcsapi;

// create an API handler
$api		=	new Whmcsapi();

// Set options
$api->setUsername( 'apiadmin' );
$api->setPassword( 'password' );
$api->setUrl( 'http://url.to.your/whmcs/' );
$api->setLogpath( '\absolute\path\to\log\entries' );

// Init
$api->init();

// Call API up
$result		=	$api->getclientsdetails( array( 'userid' => 1 ) );

API Reference

When creating the API handler, you can also pass the options along as an array such as:

$api    = new Whmcsapi( array( 'username' => 'apiadmin', 'password' => 'password', 'url' => 'http://url.to.your/whmcs/', 'logpath' => '\absolute\path\to\log\entries' ) );
$result = $api->getclientsproducts( array( 'userid' => 1 ) );

If all four entries are present you can skip the init() call, as that will be done for you.

Any API method supported by WHMCS can be called directly as a method of the object. For example:

$api->addorder();
$api->getclients();
$api->addbannedip();
...