Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function adds a new license to a Manage2 account.

Examples 


 Browser-based Calls
XML
https://manage2.cpanel.net/XMLlicenseAdd.cgi?ip=127.0.0.1&packageid=8&groupid=13&force=1&reactivateok=0&dryrun=0
JSON
https://manage2.cpanel.net/XMLlicenseAdd.cgi?output=json&ip=127.0.0.1&packageid=008&groupid=013&force=1&reactivateok=0&dryrun=0
YAML
https://manage2.cpanel.net/XMLlicenseAdd.cgi?output=yaml&ip=127.0.0.1&packageid=008&groupid=013&force=1&reactivateok=0&dryrun=0
 cPanel Licensing PHP Class
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("barney@example.com", "12345luggage");
$lisc = (array)$cpl->activateLicense(array(
    "ip" 		  => "127.0.0.1", 
	"groupid"     => "013", 
	"packageid"   => 008", 
	"force" 	  => "1", 
	"reactiateok" => "0",
	"dryrun"      => "0"
	)
);
?>
 cPanel Licensing Perl Module
use cPanelLicensing;
my $licenseManager = new cPanelLicensing(user => "barney\@example.com", pass => "12345luggage");
my $liscid = $licenseManager->activateLicense(
	'groupid'     => '013', 
	'packageid'   => '002', 
	'ip' 		  => '127.0.0.1', 
	'force' 	  => '1', 
	'reactvateok' => '0',
	"dryrun"      => "0"
);
 Output (XML)
<XMLlicenseAdd licenseid="6793969" monthly_price="21.34" price="0.00" promoinfo="" reason="Activated TESTCOMPANY-INTERNAL license on 127.0.0.1 in the 'foo' group." status="1" yearly="0"/>
 Output (JSON)
 {
  "monthly_price": "21.34",
  "status": 1,
  "yearly": 0,
  "reason": "Activated TESTCOMPANY-INTERNAL license on 127.0.0.1 in the 'foo' group.",
  "price": "100.00",
  "promoinfo": "",
  "licenseid": "6793969"
}
 Output (YAML)
--- 
licenseid: '6793969'
monthly_price: 21.34
price: 100.00
promoinfo: ''
reason: Activated TESTCOMPANY-INTERNAL license on 127.0.0.1 in the 'foo' group.
status: 1
yearly: 0 

Parameters

ParameterTypeDescriptionPossible valuesExample
ipstring

Required

The IP address for which to add a license.

A valid IP address.127.0.0.1
packageidstring

Required

The package's ID number.

A valid package ID.

The List Package Information function returns a list of possible values.

008
groupidstring

Required

The ID of the group to which to add the license.

A valid group ID.

The Display Groups function returns a list of possible values.

013
forceBoolean

Whether to forcibly add the license to the specified IP address.

This parameter defaults to 1.

  • 1 — Forcibly add the license.
  • 0 — Do not forcibly add the license.
0
reactivateokBoolean

Whether to display error messages and price information, but not activate the license.

This parameter defaults to 0.

  • 1 — Reactivate the license if it will incur a reactivation fee.
  • 0 — Do not activate the license if it will incur a reactivation fee.
0
dryrunBoolean

Whether to display whether a license reactivation will incur an additional fee, but not activate the license.

This parameter defaults to 0.

  • 1 — Display fee information but do not activate the license.
  • 0 — Do not display fee information but do activate the license.
1

Returns

ReturnTypeDescriptionPossible valuesExample
licenseidintegerThe new license ID.A positive integer.123
monthly_priceintegerThe monthly price of a license.A numeric value that measures the price, in US Dollars.25.00
priceinteger

The price of a license.

A numeric value that measures the price, in US Dollars.150.00
promoinfostringInformation about any applied promotional rates.
  • A string value.
  • " "No promotion applied.
""
reasonstring

Information about the license activation.

A string value.Activated TESTCOMPANY-INTERNAL license on 127.0.0.1 in the 'foo' group.
statusBooleanWhether the function succeeded.
  • 1 — Success.

  • 0 — Failure.
1
yearlyBooleanWhether the license is a yearly license.
  • 1 — A yearly license.
  • 0 — Not a yearly license.
0