Add Licenses — XMLlicenseAdd.cgi

This Manage2 function allows you to add a new license.

Variables

Input

  • ip (string) — The IP address to which you wish to add the license.
    • Example: 127.0.0.1
      PICK Remember: This is a required variable.
  • groupid (string) — The identification number of the group to which the new license will be assigned, beginning with G.
    • Example: G0001
  • packageid (string) — The identification number of the package assigned to the new license, beginning with P.
    • Example: P0023
  • legal (boolean) — This variable is a value the represents whether or not you agree to the following terms: "To the best of my knowledge, the license I am about to add is not for a machine owned, operated, or located in a country and/or person that US export regulations prohibit."
    • 1 — Confirms that you agree to the conditions listed above.
    • 0 — Represents that you do not agree to the conditions listed above.
  • force (boolean) — Forces the license to be added to the IP addresses specified.
    PICK Remember: This is an optional variable.
    • 1 — Results in the a forced licensing.
    • 0 — The new license will not be forced upon the specified IP address.
  • reactivateok (boolean) — Allows licenses to be reactivated that would generate a reactivation fee because they were deactivated within 48 hours of billing..

Output

  • licenseid (string) — The ID of the new license.
    • Example: 0001
  • promoinfo (string) — Describes whether or not the new license was given any promotional deal.
  • reason (string) — Information about the license addition.
  • status (integer) — Describes whether the new licenses has been successfully added to your account.
    • 1 — The license has been successfully added.
    • 0 — The license has not been added.
    • -1 — The license has not been added because you entered invalid input data.
  • version (float) — Internal information used by the Manage2 API.
  • yearly (boolean) — Describes whether the license that has been added is a yearly license.
    • 1 — The license that has been added is a yearly license.
    • 0 — The license that has been added is not a year license.

Examples

Using HTTP (direct API call)

Show Hide

Calling http://manage2.cpanel.net/XMLlicenseAdd.cgi?legal=1&groupid=G0001&packageid=P001&force=0&ip=127.0.0.1 in a web browser will produce XML output similar to the following:

<XMLlicenseAdd licenseid="0001" promoinfo="eligible, 
but no promotions are active on your account..." 
reason="OK" status="1" version="0.4" yearly="0"/>

Calling the function using the URL above will return XML data by default. To change the output format that will be returned, use either of the following URLs:

  • JSONhttp://manage2.cpanel.net/XMLlicenseAdd.cgi?output=json&legal=1&groupid=G0001&packageid=P001&force=0&ip=127.0.0.1
  • YAMLhttp://manage2.cpanel.net/XMLlicenseAdd.cgi?output=yaml&legal=1&groupid=G0001&packageid=P001&force=0&ip=127.0.0.1
For more information about each of these output types, visit our Choosing an Output Type documentation.

Using a Perl module

Show Hide

The following is an example of a Perl module that will call XMLlicenseAdd.cgi. You can use this module to pass input variables to a Manage2 API function. You will need to edit the example below to suit your needs.

use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
    $cpl-> activateLicense(
    groupid=>$groupid
    packageid=>$packageid
    ip=>$ip
    force=>$force
)

In the example above:

  • $ip — The IP address of the server being provisioned a new license.
  • $groupid — The ID of the group to which the new license will belong.
  • $packageid — The ID of the package that the new license will use.
  • $force — Specifies whether the creation of the new account should be forced.
    • note Note: $force is an optional variable.

You can learn more about using a Perl module to call API functions.

Using a PHP class

Show Hide

The following is an example showing how to call the cPanelLicensing PHP class. You can use this class to pass input variables to the Manage2 API using a few short calls.

<?php

include("cpl.inc.php");

$cpl = new cPanelLicensing("__USERNAME__","__PASSWORD__");
$lisc = $cpl->activateLicense(array(
		"ip" => $ip,
		"groupid" => $groupid,
		"package" => $packageid,
		"force" => $force
	)
);

?>

In the example above:

  • $ip — The IP address of the server being provisioned a new license.
  • $groupid — The ID of the group to which the new license will belong.
  • $packageid — The ID of the package that the new license will use.
  • $force — Specifies whether the creation of the new account should be forced.

PICK Remember: __USERNAME__ and __PASSWORD__ are meant to represent the username and password for your Manage2 account.

You can learn more about using a PHP class to call API functions.

Topic revision: r20 - 20 Apr 2011 - 14:54:50 - Main.MelanieSeibert
ManageTwo.XMLAddLicense moved from Sandbox.XMLAddLicense on 21 Jul 2009 - 19:12 by Main.JustinSchaefer - put it back
 

Copyright © cPanel 2000–2011.