Manage2 API Function - List License Information


Last modified: March 16, 2021

Description

This function returns a list of the Manage2 account’s licenses.

Examples

XML

https://manage2.cpanel.net/XMLlicenseInfo.cgi?expired=1&groupid=G001&maxage=2

JSON

https://manage2.cpanel.net/XMLlicenseInfo.cgi?output=json&expired=1&groupid=G001&maxage=2

YAML

https://manage2.cpanel.net/XMLlicenseInfo.cgi?output=yaml&expired=1&groupid=G001&maxage=2

Important:

If you use this method to call the function, you may need to increase your PHP memory limit.

1
2
3
4
5
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("username@example.com","123456luggage");
$lisc = $cpl->fetchExpiredLicenses();
?>

Return expired licenses:

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

Return active licenses:

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

Return licenses for a group and package:

1
2
3
4
5
6
use cPanelLicensing;
my $cpl = cPanelLicensing->new(user => "username\@example.com", pass => "123456luggage");
my $response = $licenseManager->fetchLicenses(
    'groupid' => '208850',
    'package' => 'ExamplePackage'
);


1
2
3
<XMLlicenseInfo reason="OK" status="1" version="0.7">
    <licenses name="L10742947" adddate="1591995380" distro="Centos Enterprise 5.8" envtype="" expiredon="" expirereason="" groupid="208850" hostname="example.com" ip="192.0.2.0" licenseid="10742947" maxusers="30" os="Mac OS X" osver="10.9" packageid="761" producttype="1" status="1" updateexpiretime="" version="11.86.0.37"/>
</XMLlicenseInfo>

 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
{
  "version": 0.7,
  "status": 1,
  "reason": "OK",
  "licenses": {
    "L4921062": {
      "adddate": "1591995380",
      "distro": "Centos Enterprise 5.8",
      "envtype": null,
      "expiredon": null,
      "expirereason": null,
      "groupid": "208850",
      "hostname": "example.com",
      "ip": "192.0.2.0",
      "licenseid": "10742947",
      "maxusers": "30",
      "os": "Mac OS X",
      "osver": "10.9",
      "packageid": "761",
      "producttype": "1",
      "status": "1",
      "updateexpiretime": null,
      "version": "11.86.0.37"
    }
  }
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
version: 0.7
status: 1
reason: OK
licenses:
  L4921062:
    adddate: '1591995380'
    distro: Centos Enterprise 5.8
    envtype: ~
    expiredon: ~
    expirereason: ~
    groupid: '208850'
    hostname: example.com
    ip: 192.0.2.0
    licenseid: '10742947'
    maxusers: '30'
    os: Mac OS X
    osver: '10.9'
    packageid: '761'
    producttype: '1'
    status: '1'
    updateexpiretime:
    version: 11.86.0.37

Parameters

Important:
  • You can call the groupid or group parameters, but not both.
  • You can call the package or packageid parameters, but not both.

This function accepts the following parameters:

Parameter Type Description Example
expired Boolean Whether to return expired or active licenses:
  • 1 — Return expired licenses.
  • 0 — Return active licenses.
Important:
Only pass this parameter when you call the function in a browser.
1
groupid string The group ID for which to return a list of licenses. The Manage2 Display Groups function returns a list of possible values.

If you do not use this parameter or the group parameter, the function returns licenses from all available groups.
G001
group string The group name for which to return a list of licenses. The Manage2 Display Groups function returns a list of possible values.

If you do not use this parameter or the groupid parameter, the function returns licenses from all available groups.
examplegroup
maxage integer The number of days of licenses to return:
  • A valid integer.
  • null or 1 — An unlimited list of licenses.
This parameter defaults to null.
7
packageid string The package ID for which to return a list of licenses. The Manage2 List Package Information function returns a list of possible values.

If you do not use this parameter or the package parameter, the function returns licenses from all available packages.
P001
package string The package name for which to return a list of licenses. The Manage2 List Package Information function returns a list of possible values.

If you do not use this parameter or the packageid parameter, the function returns licenses from all available packages.
ExamplePackage

Returns

This function returns the following values:

Return Type Description Example
licenses object An object containing license information.
    accounts integer The number of active accounts.

The function returns this value in the licenses object.
30
    adddate integer The date that the account added the license, in Unix format.

The function returns this value in the licenses object.
1591995380
    addedby integer The ID of the account that added the license.

The function returns this value in the licenses object.
297427
    autoscale_package integer The projected billing package’s ID.

The function returns this value in the licenses object.
4
    distro string The operating system distribution’s name.

The function returns this value in the licenses object.
Centos Enterprise 5.8
    envtype string The virtualization platform, if one exists.
  • A distribution platform name.
  • "" or null — No virtualization platform.
The function returns this value in the licenses object.
""
    expiredon integer The date on which the license expired:
  • A timestamp, in Unix format.
  • "" or null — The license is active.
The function returns this value in the licenses object.
1594587380
    expirereason string The reason why the license expired.
  • A string value.
  • "" or null — The license is active.
The function returns this value in the licenses object.
No payment received
    groupid integer The license’s group ID.

The function returns this value in the licenses object.
0001
    hostname string The license’s server’s hostname.

The function returns this value in the licenses object.
example.com
    host_type string The host type (virtual or dedicated) the license requires:
  • virtual
  • dedicated
The function returns this value in the licenses object.
virtual
    ip string The license’s server’s IP address.

The function returns this value in the licenses object.
192.0.2.0
    licenseid string The license’s ID.

The function returns this value in the licenses object.
10742947
    maxusers integer The maximum number of accounts that the license allows.

The function returns this value in the licenses object.
30
    os string The license’s server’s operating system.

The function returns this value in the licenses object.
Mac OS X
    osver string The operating system’s version number.

The function returns this value in the licenses object.
10.9
    packageid integer The license’s package ID.

The function returns this value in the licenses object.
761
    packageqty integer The number Enkompass accounts that ship with the license:
  • 1 — 500 Enkompass accounts.
Important:
This return is deprecated. cPanel, L.L.C. no longer supports Enkompass.
The function returns this value in the licenses object.
1
    producttype integer The product type ID:
  • 1 — cPanel & WHM
  • 2 — Enkompass
  • 4 — RESERVED
  • 8 — SiteZen
  • 16 — CloudLinux™
  • 32 — KernelCare
  • 64 — DNSOnly
  • 128 — LiteSpeed Web Server
  • 256 — Imunify360
  • 512 — WHMCS
  • 1024 — JetBackup
The function returns this value in the licenses object.
1
    status integer The license’s status:
  • 1 — Active.
  • 2 — Expired.
  • 4 — Suspended.
The function returns this value in the licenses object.
1
    termexpires_months integer The time remaining until the license expires, in months.

The function returns this value in the licenses object.
100
    termexpires_unixtime integer The date on which the license will expire:
  • A timestamp, in Unix format.
  • "" or null — The license is active.
The function returns this value in the licenses object.
1594587380
    updateexpiretime integer The time at which the license will expire:
  • A timestamp, in Unix format.
  • N/A — The license does not apply.
The function returns this value in the licenses object.
1638244382
    version string The product’s version number.
  • A product version number.
  • null — No product version number available.
The function returns this value in the licenses object.
11.86.0.37
reason string Information about the license display operation. OK
status Boolean Whether the function succeeded:
  • 1 — Success.
  • 0 — Failure.
1
version float Internal information that the Manage2 API uses to identify the version. 0.7

Additional Documentation