List Package Information — XMLpackageInfo.cgi

This Manage2 function allows you to retrieve a list of all packages associated with your Manage2 account.

Variables

Input

  • None

Output

  • reason (string) — Information about the package listing operation.
  • status (boolean) — Describes whether the package information associated with your Manage2 account was returned successfully.
    • 1 — The information was successfully returned.
    • 0 — The information was not returned.
  • packages (hash) — Contains all of the package IDs and packages associated with your Manage2 account.
    • Example: packages P001="Package Name" P002="Package Name 2" ...

Examples

Using HTTP (direct API call)

Show Hide

Calling http://manage2.cpanel.net/XMLpackageInfo.cgi in a web browser will produce XML output similar to the following:

<XMLpackageInfo reason="OK" status="1" version="0.3">
     <packages P001="ONE TIME FEE" P002="THREE-YEAR" 
     P003="ONE-YEAR" P003="TWO-YEAR"/>
</XMLpackageInfo>

Calling the function using the URL above will return XML data by default. To change the output format that will be returned, use either of the following URLs:

  • JSONhttp://manage2.cpanel.net/XMLpackageInfo.cgi?output=json&
  • YAMLhttp://manage2.cpanel.net/XMLpackageInfo.cgi?output=yaml&
For more information about each of these output types, visit our Choosing an Output Type documentation.

Using a Perl module

Show Hide

The following is an example of a Perl module that will call XMLpackageInfo.cgi. You can use this module to pass input variables to a Manage2 API function. You may need to edit the example below to suit your needs.

use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
    $cpl->fetchPackages()

PICK Remember: This function does not take any input variables.

You can learn more about using a Perl module to call API functions.

Using a PHP class

Show Hide

The following is an example showing how to call the cPanelLicensing PHP class. You can use this class to pass input variables to the Manage2 API using a few short calls.

<?php

include("cpl.inc.php");

$cpl = new cPanelLicensing("__USERNAME__","__PASSWORD__");
$lisc = $cpl->fetchPackages();

?>

PICK Remember: This function does not take any input variables.

PICK Remember: __USERNAME__ and __PASSWORD__ are meant to represent the username and password for your Manage2 account.

You can learn more about using a PHP class to call API functions.

Topic revision: r14 - 22 Apr 2011 - 00:42:38 - Main.JustinSchaefer
ManageTwo.XMLPackageInfo moved from Sandbox.XMLPackageInfo on 21 Jul 2009 - 19:11 by Main.JustinSchaefer - put it back
 

Copyright © cPanel 2000–2011.