Skip to end of metadata
Go to start of metadata

Introduction

The Manage2 API automates cPanel license management procedures.

For example, use this API to reactivate a customer's cPanel license.

Warning:

You must authenticate with the proper permissions to call a function. Add the IP address from which to call the function to the Manage2 profile in Manage2's Add an Access IP interface (Dashboard >> Security >> Add an Access IP).

Basic usage

https://manage2.cpanel.net/function?output=style&parameter=value

Warning:

You must pass the username and password to the module when you instantiate the PHP class.

For more information, read our Manage2 API - cPanel Licensing PHP Class documentation.

<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing(user, pass);
$license = $cpl->variable(array("parameter" => $value));
?>

Warning:

You must pass the username and password to the module when you instantiate the Perl class.

For more information, read our Manage2 API - cPanelLicensing Perl Module documentation.

use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => user, pass => pass);
    my $variable = $cpl->function(parameter => value);
curl 'https://manage2.cpanel.net/function?output=json&parameter=value'

You can also include the function and variables in separate strings, separated by the data (-d) flag. For example:

curl 'https://manage2.cpanel.net/function' -d 'output=style&parameter=value'

Warning:

If you use the -d flag, the system ignores any variables that you pass in the string before the -d flag. For example:

curl 'https://manage2.cpanel.net/function?output=style' -d 'parameter=value'

If you attempt to call the function via this format, the system will ignore the output=style variable.

This example uses the following variables:

VariableDescriptionPossible valuesExample
functionThe Manage2 API function.Any Manage2 API function.XMLlicenseReActivate
output

The template for the return data, in output=style format.

Note:

  • This variable is optional. The Manage2 API returns XML output by default.
  • You can change the output format in the browser call to return JSON or YAML. For more information, read our Return Data documentation.
For a list of possible values, read the Return Data documentation.output=json
parameter

The parameters that you pass to the function, in parameter=value format.

Note:

For an array of hashes, use the ::variable template: format.

A vaild parameter.liscid
valueThe parameter's value.

Any possible value for the specified parameter.

liscid="0001"

Browser Session URL calls

You can access Manage2 API functions directly from any web browser when you call a function from a Manage2 session.

Browser-based calls consist of the following basic parts:

PartDescription
ServerThe HTTP address of the Manage2 account.
FunctionThe Manage2 API function.
Output

The function's output style.

Remember:

  • This variable is optional. The Manage2 API returns XML output by default.
  • You can change the output format in the browser call to return JSON or YAML. For more information, read our Return Data documentation.
Parameters and valuesThe function's parameters and their values.