Display Groups — XMLgroupInfo.cgi

This Manage2 function allows you to retrieve a list of the groups associated with your Manage2 account.

Variables

Input

  • None

Output

  • reason (string) — Information about the group listing operation.
  • status (boolean) — Describes whether the data has been retrieved successfully.
    • 1 — The data has been successfully retrieved.
    • 0 — The data was not returned.
  • version (float) — Internal information used by the Manage2 API.
  • groups (hash) — This variable contains all of the the group IDs and group names associated with your Manage2 account.
    • Example: groups G0001="Group Name" G0002="Group 2 Name" ...

Examples

Using HTTP (direct API call)

Show Hide

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

<XMLgroupInfo reason="OK" status="1" version="0.4">
     <groups G0001="ExampleGroup" G0002="" 
     G0003="Training Server*" G0003="Training Server 2*" 
     G0004="Enterprise" G00005="Enterprise 2" G0006="Testing 
     Server"/>
</XMLgroupInfo>

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/XMLgroupInfo.cgi?output=json&
  • YAMLhttp://manage2.cpanel.net/XMLgroupInfo.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 XMLgroupInfo.cgi. You can use this module to pass input variables to a Manage2 API function. You will need to edit the example below to suit your needs.

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

PICK Remember: This function does not accept 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->fetchGroups();

?>

PICK Remember: This function does not accept 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 - 21 Feb 2013 - 20:17:15 - Main.ColinShannon
ManageTwo.XMLGroupInfo moved from Sandbox.XMLGroupInfo on 21 Jul 2009 - 19:12 by Main.JustinSchaefer - put it back