Bulk Bandwidth/Disk Usage API call

Paul, or any other iworx person, would it be possible to add an API call that would return the bandwidth/disk usage info for all domains/resellers in one go? It seems whmcs devs don’t think bandwidth/disk overage billing is a very high priority for interworx and seems to feel that querying each domain/reseller record individually is too much of a work load on the system. I think I need to prod Matt or you to talk to each other and see if this can’t be handled in a reasonable time frame.

I know this isn’t an interworx shortcoming but, it is really about the only thing left that doesn’t seem to be on par with support for other CPs in most other billing packages. (That is, it’d be nice to see at least once system that supports overage billing for iworx 4.)

Any assistance would be greatly appreciated. Running a consulting business along with a small shared hosting business tends to mean I can’t do some of these things done myself.


While it’s not immediately obvious, this is already possible in the current release.

You can use the querySiteworxAccountDetails action on the SiteWorx Controller to get exactly what you need.

The caveat here is that you’ll need to be provide all of the domains that you want data for. The account_data parameter would be passed an array, containing ‘domain’, ‘bandwidth_used’, and ‘storage_used’.

As I typed this all out, I realized what a pain it is, so I made a new API action as requested - listBandwidthAndStorage will be in the next build. :slight_smile:


Sweet thanks, this was actually one of the questions I was about to ask about.


This is excellent news! Thanks for such great support!


Any idea when the next build will be out or when documentation for the API action will be created in the API specs page? I’ll really feel stupid if I’ve looked over yet another thing in the docs if it has already been done.


No, this one is my fault, completely! The new action missed being included in the 263 build because I’m a twit and didn’t commit it to CVS.

It’s committed now, and WILL be included in the next build. My bad.

Controller/Call specs


What is the call input and output? what variables and in what form need to be supplied and what form do the results take?


All of the list* functions in the API do not accept input - they simply list the data. There are often corresponding query* functions, but not in this case.

At least if you’re using Zend_XmlRpc_Client, you’ll still need to provide an empty array as part of your call, for the input. I’ve not looked closely enough to know whether this is our limitation or Zend’s. Probably ours :slight_smile:

As for example output:

array (
  'status' => 0,
  'payload' => 
  array (
    0 => 
    array (
      'id' => '1',
      'domain' => 'mydomain.com',
      'bandwidth_used' => '0.00',
      'bandwidth' => '10',
      'storage_used' => '0.27',
      'storage' => '10',
    1 => 
    array (
      'id' => '57',
      'domain' => 'example.com',
      'bandwidth_used' => '0.00',
      'bandwidth' => '999999999',
      'storage_used' => '20.96',
      'storage' => '999999999',

We’re actually in the midst of a major overhaul to interworx.com. Part of the update will include these examples for every list* function.