The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API for List Packages

Discussion in 'cPanel Developers' started by vivekvsist, Feb 10, 2009.

  1. vivekvsist

    vivekvsist Active Member

    Joined:
    May 29, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    I want to list a RESELLER's package.

    I see this api, /xml-api/listpkgs

    but it will list all the packages, if we login as root.

    I want to perform something like this

    /xml-api/listpkgs?reseller=bob

    which will display bob's package

    How can I do it ?
     
  2. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    vivek,
    There currently isn't functionality for this within the XML-API, however I have opened a feature request inside of our internal bug tracker to get this functionality implemented.
     
  3. vivekvsist

    vivekvsist Active Member

    Joined:
    May 29, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Thank you.

    I just got an idea to extract the resellers package.

    Its something like this


    $reseller = "resell11";

    $reseller = $reseller ."_";

    $len = strlen($reseller);


    get all the packages

    for loop ( )

    $user =substr($result[$j]['name'], 0, $len);
    $pkg_name = $result[$j]['name'];

    if ($user == $reseller)

    echo $result[$j]['name'];


    I got this working and got the selected reseller's package
     
Loading...

Share This Page