Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

XML-API and controling WHM using remote Perl script - Help!

Discussion in 'cPanel Developers' started by jonathanwww, Jun 29, 2008.

  1. jonathanwww

    jonathanwww Registered

    Jun 29, 2008
    Likes Received:
    Trophy Points:
    I am able to get the XML API to work when I log in manually to the WHM, and execute the /xml-api/command_name?key1=value&key2=value,

    But what I am really trying to do is to write a remote perl script that access XML API on the WHM server. This will allow me to automate the creation process using my remote server.

    Can you give me an example of how this can be done via NET::SSLEAY Post?

    How does the XML API authenticate who can give it commands?

    Do I have to provide a remote access key and how as the input argument?

    I'm trying to change bandwidth limits: Am I missing some keys?

    use Net::SSLeay qw(post_https make_form make_headers);

    my($page, $response, %HEADERS) = post_https($my_server_host_name, 2087, "/xml-api/limitbw",

    user => $account_user,
    bwlimit => '1000',


    Don't I have to specify a Remote Access Key for that command to work?
  2. cPanelKenneth

    cPanelKenneth cPanel Development Staff Member

    Apr 7, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    The whmreq method in /usr/local/cpanel/Cpanel/ should point you in the right direction.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice