How to correctly call API commands that take no parameters?

Like in the topic - how to correctly do that? I’m using this perl script in order to ask InterWorx how many messages sit in remote, local and todo mail queues.
However the program isn’t finished and production ready, because I’ve written something incorrectly. ref($resp) should be RPC::XML::struct upon success, but in this example the program receives RPC::XML::fault.
I’ve had a short read of this page, but will have to sit on it later on. I can only make of it that the fault has a code and string, so it can be analyzed.
But perhaps someone else already knows the answer here? Any help would be much appreciated before I can sit on this again.


Hey grep,

I believe an input is always required, but doesn’t need to be defined. I added the following lines to your script:

my $input = RPC::XML::struct->new({});

And changed my

$resp = $cli->send_request(‘iworx.route’, $apikey,

When I run it I now get back:

nathan@work ~/InterWorx - $ perl -a testserver -s password -e

Hope this helps!

Thanks a ton Nathan! Here’s a polished and error-conscious version of the script with your corrections.
Hope this helps anyone else wanting to quickly get mail queue summaries :slight_smile: