All HostBill API methods requires authorization to use them. To get API access you need to make sure that administrator you're trying to
use API with have access enabled in Settings->Staff Members.
Using HostBill API is really simple:
1. Obtain API ID and API Key (as described below)
2. Use API ID and API Key with available functions
In order to get API ID you need to generate it under Security settings > API Acces: Video guide!
1. Login to your HostBill
2. Go to Settings > Security settings > API Acces
3. Enter your ip address and click 'Add API access'
You'll generate API ID and its API Key which you should add to every HostBill API request.
GET http://url_to_your_hostbill.com/admin/api.php?api_id=API_ID&api_key=API_KEY&call=FUNCTION
<?php include 'class.hbwrapper.php'; HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key'); $return = HBWrapper::singleton()->FUNCTION(); print_r($return); ?>
/* Use this method to access HostBill api from HostBill modules */ $api = new ApiWrapper(); $return = $api->FUNCTION(); print_r($return);
{ "success":BOOLEAN, "call":FUNCTION, "server_time":TIMESTAMP, }