Manage2 API Function - Display Groups

Last modified: November 30, 2022


Description

This function returns a Manage2 account’s groups.

Examples

Note:
To view expanded returns, add the &expand parameter to the end of each browser-based call.

XML

https://manage2.cpanel.net/XMLgroupInfo.cgi

JSON

https://manage2.cpanel.net/XMLgroupInfo.cgi?output=json

YAML

https://manage2.cpanel.net/XMLgroupInfo.cgi?output=yaml

1
2
3
4
5
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("[email protected]","123456luggage");
$lisc = $cpl->fetchGroups();
?>

1
2
3
use cPanelLicensing;
my $cpl = new cPanelLicensing(user => 'username\@example.com', pass => '123456luggage');
$cpl->fetchGroups();

Without the expand parameter:

1
2
3
<XMLgroupInfo reason="OK" status="1" version="0.5">
  <groups G294658="testgroupone" G294662="testgrouptwo" G294666="testgroupthree" G863177="testgroupfour"/>
</XMLgroupInfo>

With the expand parameter:

1
2
3
4
5
6
<XMLgroupInfo reason="OK" status="1" version="0.5">
    <group name="testgroupone" groupid="G294658"/>
    <group name="testgrouptwo" groupid="G294662"/>
    <group name="testgroupthree" groupid="G294666"/>
    <group name="testgroupfour" groupid="G863177"/>
</XMLgroupInfo>

Without the expand parameter:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "version": "0.5",
  "status": 1,
  "groups": {
    "G294658": "testgroupone",
    "G294662": "testgrouptwo",
    "G294666": "testgroupthree",
    "G863177": "testgroupfour"
  },
  "reason": "OK"
}

With the expand parameter:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  "group": [{
      "name": "testgroupone",
      "groupid": "G294658"
    },
    {
      "name": "testgrouptwo",
      "groupid": "G294662"
    },
    {
      "name": "testgroupthree",
      "groupid": "G294666"
    },
    {
      "name": "testgroupfour",
      "groupid": "G863177"

    }
  ],
  "version": "0.5",
  "status": 1,
  "reason": "OK"
}

Without the expand parameter:

1
2
3
4
5
6
7
8
9
---
version: '0.5'
status: 1
groups:
  G294658: testgroupone
  G294662: testgrouptwo
  G294666: testgroupthree
  G863177: testgroupfour
reason: OK

With the expand parameter:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
---
group:
- name: testgroupone
  groupid: G294658
- name: testgrouptwo
  groupid: G294662
- name: testgroupthree
  groupid: G294666
- name: testgroupfour
  groupid: G863177
version: '0.5'
status: 1
reason: OK

Parameters

This function accepts the following parameters:

Return Type Description Example
expand string Displays the group return. This parameter does not accept values. expand

Returns

This function returns the following values:

Return Type Description Example
reason string Information about the group display operation. OK
status Boolean Whether the function succeeded:
  • 1 — Success.
  • 0 — Failure.
1
version numeric Internal information that the Manage2 API uses to identify the version. 0.4
groups object A list of the account’s group names and group IDs.
Note:
This return only appears when you do not use the expand parameter.
group array of objects An array of objects containing expanded group information.
Note:
This return only appears when you use the expand parameter.
groupid string The group’s ID number.

The function returns this value in the groups object.
G294658
maingroup Boolean Default group to which new licenses are added unless a group is explicitly defined.
Whether the maingroup is true:
  • 1 — True.
  • 0 — False.
1
country string The country of the datacenter in which licenses in the group are hosted. US
stateprov string The state or province of the datacenter in which licenses in the group are hosted. TX
city string The city name the datacenter in which licenses in the group are hosted. Houston
postcode string The post code of the address of the datacenter in which licenses in the group are hosted. 77092
addr1 string The street number and street name of the address of the datacenter in which licenses in the group are hosted. 1234 Virtual St
addr2 string The suite or apartment number of the address of the datacenter in which licenses in the group are hosted, if applicable. 716
name string The group’s name.

The function returns this value in the groups object.
testgroupone

Additional Documentation