[BlueOnyx:14276] Re: API, am I doing this right?

Michael Stauber mstauber at blueonyx.it
Mon Jan 20 14:00:40 -05 2014


Hi Chris,

> I have verified that to be the case.
> "Product Type" = "Hosting Account"
> "Product Group" = "Web Hosting"

Hmm ... should be right. Please check under "Setup" /
"Products/Services" / "Server".

It shows the servers that you have configured and there is also the
button "Login to Control Panel" and the "AM-Status" next to it.

AM-Status should report "OK". Check if you can login to the GUI using
the button there. If not, the password might be wrong, as it just
happened with my own WHMCS test-rig.

> I have not modified anything at the WHMCS end in some time (not since 
> installing the BlueOnyx module), so I'm unsure why it has stopped working.

On my end my WHMCS box didn't check at all. The target box where I run
the test account is a 5108R that's running the YUM updates out of the
"testing" YUM repository. But the BlueOnyx side of the API didn't change
in between. I just updated the localization files, but not the actual
PHP page that WHMCS posts the data to.

> In addition, the other module tasks appear to have stopped working as 
> well.   ie: Suspend, Unsuspend, Change Password, etc.

The error message you get is created by this file:

/usr/sausalito/ui/web/base/api/index.php

See line 139ff:

if (($_POST['action'] == "create") && ($payload->producttype !=
"hostingaccount")) {
  echo "BlueOnyx API: At this time only producttype 'hostingaccount' is
supported.";
  error_log("BlueOnyx API: At this time only producttype
'hostingaccount' is supported.");
  // nice people say aufwiedersehen
  $helper->destructor();
  exit;
}

It is triggered past the authentication stage (line 61-69), so at that
point we have a valid username (admin) and the correct password. We also
have a POST request and the POST payload contains the action "create".

However, the JSON encoded payload doesn't have the right producttype.

Do this for debugging:

In line 138 (above the section of code I posted above) add this:

error_log("Payload: " . $payload->producttype);

Then tail /var/log/admserv/adm_error while you do another create
transaction. It should log what producttype WHMCS is posting to the API.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list