Manage2 API Function - Display Groups


Last modified: March 12, 2021

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("username@example.com","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" taxrate="0.0825" taxstate="TX"/>
    <group name="testgrouptwo" groupid="G294662" taxrate="0.0825" taxstate="TX"/>
    <group name="testgroupthree" groupid="G294666" taxrate="0.0825" taxstate="TX"/>
    <group name="testgroupfour" groupid="G863177" taxrate="0.0825" taxstate="TX"/>
</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
24
25
26
27
28
29
30
{
  "group": [{
      "taxrate": "0.0825",
      "name": "testgroupone",
      "groupid": "G294658",
      "taxstate": "TX"
    },
    {
      "taxrate": "0.0825",
      "name": "testgrouptwo",
      "groupid": "G294662",
      "taxstate": "TX"
    },
    {
      "taxrate": "0.0825",
      "name": "testgroupthree",
      "groupid": "G294666",
      "taxstate": "TX"
    },
    {
      "taxrate": "0.0825",
      "name": "testgroupfour",
      "groupid": "G863177",
      "taxstate": "TX"
    }
  ],
  "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
14
15
16
17
18
19
20
21
---
group:
- taxrate: '0.0825'
  name: testgroupone
  groupid: G294658
  taxstate: TX
- taxrate: '0.0825'
  name: testgrouptwo
  groupid: G294662
  taxstate: TX
- taxrate: '0.0825'
  name: testgroupthree
  groupid: G294666
  taxstate: TX
- taxrate: '0.0825'
  name: testgroupfour
  groupid: G863177
  taxstate: TX
version: '0.5'
status: 1
reason: OK

Parameters

This function accepts the following parameters:

Return Type Description Example
expand string Displays the taxstate and taxrate returns. This parameter does not accept values. expand

Returns

This function returns the following values:

Return Type Description Example
groups object A list of the account’s group names and group IDs.
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 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
    name string The group’s name.

The function returns this value in the groups object.
testgroupone
    taxstate string The group’s US state. One of:
  • A two-letter abbreviation for a US state.
  • null — No state.
The function returns this value in the groups object.
TX
    taxrate numeric The sales tax rate:
  • A numeric value between 0 and 1.
  • null — Not taxable.
The function returns this value in the groups object.
0.0825

Additional Documentation