Results 1 to 2 of 2

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

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    1

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

    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",

    make_form(
    user => $account_user,
    bwlimit => '1000',
    )

    );

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

  2. #2
    cPanel Development cPanelKenneth's Avatar
    Join Date
    Apr 2006
    Posts
    4,131
    cPanel/WHM Access Level

    Root Administrator

    Default

    The whmreq method in /usr/local/cpanel/Cpanel/Accounting.pm should point you in the right direction.

Similar Threads

  1. Cannot Create New Email Accounts with XML API Script
    By christsealed in forum E-mail Discussions
    Replies: 1
    Last Post: 04-30-2011, 06:48 PM
  2. xml-api script works only sometimes?
    By progamerinc in forum cPanel Developers
    Replies: 5
    Last Post: 04-20-2010, 03:52 PM
  3. XML/JSON API Function to retreive the 'Remote Access Key'
    By shaun in forum Feature Requests for cPanel & WHM
    Replies: 4
    Last Post: 02-08-2010, 02:36 PM
  4. Remote backup using XML-API?
    By CrazyMerlin in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 02-06-2009, 08:28 AM
  5. WHM XML-API using C# - Help
    By serverportugal in forum cPanel Developers
    Replies: 1
    Last Post: 01-18-2009, 06:28 AM