Page tree
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
JSON
https://manage2.cpanel.net/XMLlicenseInfo.cgi?output=json&expired=1&groupid=G001
YAML
https://manage2.cpanel.net/XMLlicenseInfo.cgi?output=yaml&expired=1&groupid=G001
 cPanel Licensing PHP Class
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 web 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
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:

  • name
  • adddata
  • distro
  • envtype
  • expiredon
  • expirereason
  • groupid
  • hostname
  • ip
  • licenseid
  • os
  • osver
  • packageid
  • status
  • updateexpiretime
  • version
 

name

string

The license's ID.

The function returns this value in the licenses hash.

A valid license ID.

The Display Groups function returns a list of possible values.

L10742947

adddate

integer

The date on which the license was added.

The function returns this value in the licenses hash.

A timestamp, in Unix format.
1439152264

distro

string

The operating system distribution.

The function returns this value in the licenses hash.

An operating system distribution name. Unix®

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.

1529153298

expirereason

string

The reason why the license expired.

The function returns this value in the licenses hash.

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

hostname

string

The license's server's hostname.

The function returns this value in the licenses hash.

A valid domain name.example.com

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

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

string

The license's package ID.

The function returns this value in the licenses hash.

A valid package ID.761

status

Boolean

Whether the function succeeded.

The function returns this value in the licenses hash.

  • 1 — The function succeeded.
  • 0 — The function failed.
1

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 on One Time Licenses, please read our documentation.

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

version

integer

Internal information that the Manage2API uses to identify the version.

The function returns this value in the licenses hash.

A numeric value.1