We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • Manage2 API Functions - List License Information
Skip to end of metadata
Go to start of metadata

Description

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

Examples


 Browser-based Calls
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
 cPanel Licensing PHP Class

Important:

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

Return expired licenses
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("barney@example.com","12345luggage"); 
$lisc = $cpl->fetchExpiredLicenses(); 
?>
Return active licenses
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("barney\@example.com","12345luggage"); 
$lisc = $cpl->fetchLicenses(); 
?>
Return licenses for a group and package
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("barney@example.com","12345luggage");
$response = $cpl->fetchLicensesByGroupOrPackage( array(
    'groupid' => 'G001',
    'package' => 'ExamplePackage'
));
?>
 cPanel Licensing Perl Module
Return expired licenses
use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => "user\@example.com", pass => "12345luggage");
    $cpl->fetchExpiredLicenses()
Return active licenses
use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => "user\@example.com", pass => "12345luggage");
    $cpl->fetchLicenses()
Return licenses for a group and package
use cPanelLicensing;
my $cpl = cPanelLicensing->new(user => "user\@example.com", pass => "12345luggage");
my $response = $licenseManager->fetchLicenses(
    'groupid' => 'G001',
    'package' => 'ExamplePackage'
);
 Output (JSON)
{
  "version": 0.7,
  "status": 1,
  "reason": "OK",
  "licenses": {
    "L4921062": {
      "status": "1",
      "ip": "52.52.52.5",
      "hostname": null,
      "os": null,
      "expiredon": null,
      "groupid": "43039",
      "packageqty": "1",
      "licenseid": "4921062",
      "adddate": "1302037216",
      "expirereason": null,
      "distro": null,
      "packageid": "761",
      "version": null,
      "maxusers": null,
      "envtype": null,
      "osver": null,
      "updateexpiretime": null
    },
}
 Output (XML)
<XMLlicenseInfo reason="OK" status="1" version="0.7">
	<licenses name="L10742947" adddate="1439152264" distro="" envtype="" expiredon="" expirereason="" groupid="208850" hostname="" ip="52.52.91.12" licenseid="10742947" maxusers="5000" os="" osver="" packageid="1706" packageqty="10" status="1" updateexpiretime="" version=""/>
</XMLlicenseInfo>
 Output (YAML)
--- 
licenses: 
  L10742947: 
    adddate: 1439152264
    distro: ~
    envtype: ~
    expiredon: ~
    expirereason: ~
    groupid: 208850
    hostname: ~
    ip: 52.52.91.12
    licenseid: 10742947
    maxusers: 5000
    os: ~
    osver: ~
    packageid: 1706
    packageqty: 10
    status: 1
    updateexpiretime: ~
    version: ~

Parameters

ParameterTypeDescriptionPossible valuesExample
expiredBoolean

Whether to return expired or active licenses.

Important:

Only pass this parameter when you call the function in a browser.

  • 1 — Return expired licenses.
  • 0 — Return active licenses.
1
groupidstring

The group ID for which to return a list of licenses.

Note:

You can specify either the groupid or group parameters, but not both.

If you do not use this parameter or the group parameter, the function returns licenses from all available groups.

A valid group ID.

Note:

The Display Groups function returns a list of available groups and group IDs.

G001
groupstring
The group name for which to return a list of licenses.

Note:

You can specify either the groupid or group parameters, but not both.

If you do not use this parameter or the groupid parameter, the function returns licenses from all available groups.

A valid group name.

Note:

The Display Groups function returns a list of available groups and group IDs.

ExampleGroup
maxageinteger

Number of days of licenses to return.

This parameter defaults to null.

  • A valid integer.
  • null or 1 — An unlimited list of licenses.
7
packageidstring

The package ID for which to return a list of licenses.

Note:

You can specify either the packageid or package parameters, but not both.

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

A valid package ID.

Note:

The List Package Information function returns a list of available packages and package IDs.

P001
packagestring

The package name for which to return a list of licenses.

Note:

You can specify either the packageid or package parameters, but not both.

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

A valid package name.

Note:

The List Package Information function returns a list of available packages and package IDs.

ExamplePackage

Returns

ReturnTypeDescriptionPossible valuesExample
reasonstringInformation about the license check.A string value.Risk Data Fetched
statusBooleanWhether the function succeeded.
  • 1 — The function succeeded.

  • 0 — The function failed.
1
versionfloatInternal information that the Manage2 API uses.This value has a variety of possible returns and types.1
licenseshashA hash that contains license information.

This hash contains the following returns:

  • accounts
  • adddate
  • addedby
  • autoscale_package
  • distro
  • envtype
  • expiredon
  • expirereason
  • groupid
  • hostname
  • host_type
  • ip
  • licenseid
  • maxusers
  • os
  • osver
  • packageid
  • packageqty
  • producttype
  • status
  • termexpires_months
  • termexpires_unixtime
  • updateexpiretime
  • version

        accountsinteger

The number of active accounts.

The function returns this value in the license hash.

A numeric value.30

adddate

integer

The date that the account added the license.

The function returns this value in the licenses hash.

A timestamp, in Unix format.
1439152264

addedby

integer

The account that added the license.

The function returns this value in the licenses hash.

A valid account ID.
1439152264

autoscale_package

integer

The projected billing package's ID.

The function returns this value in the licenses hash.

A valid package ID.4

distro

string

The operating system distribution.

The function returns this value in the licenses hash.

An operating system distribution name. Centos Enterprise 5.8

envtype

string

The virtualization platform, if one exists.

The function returns this value in the licenses hash.

  • A distribution platform name.
  • "" or null — A platform does not exist.
""

expiredon

integer

The date on which the license expired.

The function returns this value in the licenses hash.

  • A timestamp, in Unix format.
  • "" or null — The license is active.
1529153298

expirereason

string

The reason why the license expired.

The function returns this value in the licenses hash.

  • A string value.
  • "" or null — The license is active.
No payment received

groupid

integer

The license's group ID.

The function returns this value in the license hash.

An integer value.0001

hostname

string

The license's server's hostname.

The function returns this value in the licenses hash.

A valid domain name.example.com

host_type

string

The host type (virtual or dedicated) the license requires.

The function returns this value in the licenses hash.

  • virtual
  • dedicated
virtual

ip

string

The license's server's IP address.

The function returns this value in the licenses hash.

A valid IP address.192.168.0.20

licenseid

string

The license's ID.

The function returns this value in the licenses hash.

A valid license ID.10742947

maxusers

integer

The maximum number of accounts that the license allows.

The function returns this value in the licenses hash.

An integer value.30

os

string

The license's server's operating system.

The function returns this value in the licenses hash.

An operating system name.Mac OS X

osver

string

The operating system's version.

The function returns this value in the licenses hash.

An operating system version number.10.9

packageid

integer

The license's package ID.

The function returns this value in the licenses hash.

A valid package ID.761

packageqty

integer

The number of Enkompass accounts that ship with the license.

Note:

This return is deprecated. cPanel, L.L.C. no longer supports Enkompass.

The function returns this value in the licenses hash.

  • 1 — 500 Enkompass accounts.
1

producttype

integer

The product type ID.

The function returns this value in the licenses hash.

A numeric value that corresponds to a product name:

  • 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
1

status

integer

The license's status.

The function returns this value in the licenses hash.

  • 1 — Active.
  • 2 — Expired.
  • 4 — Suspended.
1

termexpires_months

integer

The time remaining until the license expires, in months.

The function returns this value in the licenses hash.

A numeric value.100

termexpires_unixtime

integer

The date on which the license will expire.

The function returns this value in the licenses hash.

  • A timestamp , in Unix format.
  • "" or null — The license is active.
1529153298

updateexpiretime

integer

The time at which the license will expire.

The function returns this value in the licenses hash.

Note:

This parameter only applies to customers with a One Time License.

For information, read our One Time License documentation.

  • A timestamp, in Unix time format.
  • N/A — The license does not apply.
1638244382

version

numeric

Internal information that the Manage2 API uses to identify the version.

The function returns this value in the licenses hash.

A numeric value.11.32.3.21