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!

WHM Api question

Discussion in 'General Discussion' started by Grooby, Aug 12, 2005.

  1. Grooby

    Grooby Active Member

    Joined:
    May 26, 2005
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    151
    Hello there,

    Just started to play with WHM api, and i got one question.
    I found on cpanel website sample php using accounting module:

    Code:
     
    <?php
    
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = "localhost";
    $user = "";
    $accesshash = '';
    
    $accts = listaccts($host,$user,$accesshash,0);
    print_r($accts);
    $pkgs = listpkgs($host,$user,$accesshash,0);
    print_r($pkgs);
    ?>
    
    From where i may get $accesshash value? does it base64 encoded password to $user or something?

    Adam
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    This is generated from within WHM.

    WHM > Cluster/Remote Access > Setup Remote Access Key

    The wording if the menu options may be slightly different depending on your version of WHM/Cpanel, but that's the gist of it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Grooby

    Grooby Active Member

    Joined:
    May 26, 2005
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    151
    So before running any script i must setup this key and place it in script?

    Is there any more examples of WHM api ? like databases manipulation, ftp etc.. ?

    Adam
     
  4. SethW

    SethW Registered

    Joined:
    Aug 5, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    151
    You will only need to set up your Remote Access key one time and place it in the script. You are also not just choosing any user it needs to be a reseller. You can add thoes kinds of things to the accounting.inc.php

    Thanks
    Seth
     
Loading...

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