Page tree
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 in order to call a function. Add the IP address from which you call the function to the Manage2 profile in Manage2's Add an Access IP interface (Manage2 >> 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 it.

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 it.

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:

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.

See the Return Data documentation.output=json
parameter

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

Note:

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

Any parameter from the specified function.liscid
valueThe input parameter's value.

Parameters accept a variety of values.

liscid="0001"

Browser Session URL calls

You can access Manage2 API functions directly from any web browser when you are logged into Manage2.

Browser-based calls consist of the following basic parts:

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

The Manage2 API function's output style.

The Manage2 API returns XML output by default.

Input parameters and valuesThe Manage2 API function's input parameters and their values.