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!

Api

Discussion in 'cPanel Developers' started by Valuex.Ru, Feb 27, 2007.

  1. Valuex.Ru

    Valuex.Ru Registered

    Joined:
    Nov 2, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    151
    I see some pages about Cpanel/WHM API, but I have some questions.

    Can someone give me some links with examples of php scripts, that using API of Cpanel?
    And will be work API system on the other server, if script is working on server #1, but CPanel/WHM is on server #2?

    Sorry me, my english is very bad:)
     
  2. Shinichi Kato

    Shinichi Kato Well-Known Member

    Joined:
    Mar 7, 2005
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Saitama-ken,japan
    http://www.cpanel.net/support/docs/remoteaccess-php.htm

    example.
    server #1 IPs:111.222.333.444
    server #2 IPs:555.666.777.888

    Edit and upload phpfile to server #1.

    #!/usr/local/cpanel/3rdparty/bin/php
    <?php

    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = "555.666.777.888";
    $user = "root";
    $accesshash = '


    Past here in WHM >> Cluster/Remote Access >> Setup Remote Access Key.


    ';

    $accts = listaccts($host,$user,$accesshash,0);
    print_r($accts);
    $pkgs = listpkgs($host,$user,$accesshash,0);
    print_r($pkgs);

    ?>


    Sorry, poor english.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Valuex.Ru

    Valuex.Ru Registered

    Joined:
    Nov 2, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    151
    Found this site zubrag.com, there are some scripts, if have time, I'll see code, may be code some scripts, too
     
  4. spector

    spector Well-Known Member

    Joined:
    Jun 27, 2005
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    156
    that is not really any api. Its just a bunch of php functions using curl to access WHM and do what you ask. You can write yourself anything like that in curl.
     

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