Guide to the Manage2 API
Last modified: July 27, 2022
Overview
The Manage2 API automates cPanel license management procedures. For example, you can use the Manage2 API to reactivate your cPanel licenses.
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 (Manage2 » Dashboard » Security » Add an Access IP).
For a list of available Manage2 API functions, read our Manage2 API documentation.
Manage2 API basic information
- Languages — PHP, Perl
- Methods — GET, POST
- Return Formats — XML, JSON, YAML
Basic usage
You can access Manage2’s API functions with the following methods:
Browser-based calls
You can access Manage2 API functions directly from any web browser when you call a function from a Manage2 session. For example:
https://manage2.cpanel.net/XMLlicenseReActivate.cgi?output=json&liscid=12345
This example uses the following variables:
Variable | Description | Example |
---|---|---|
function |
The Manage2 API function. | XMLlicenseReActivate |
output |
Note:
This variable is optional.
output=style format:
|
output=json |
parameter |
The parameters passed to the function, in parameter=value format. |
liscid |
value |
The parameter’s value. | 12345 |
Browser session URL call parts
Browser-based Manage2 API calls resemble the following example:
Browser-based Manage2 API calls consist of the following basic parts:
Part | Description |
---|---|
Server | The HTTP address of the Manage2 account. |
Function | The Manage2 API function name, followed by a question mark (? ) character. |
Output | The function’s output style. For more information, read our Manage2 Return Data documentation. |
Parameters and values | The function’s parameters and their values. |
The cPanelLicensing PHP class
You can access Manage2 API functions via the cPanelLicensing
PHP class:
|
|
You must pass the username (for example, [email protected]
) and password (for example, 123456luggage
) when you instantiate the PHP class.
This example uses the following variables:
Variable | Description | Example |
---|---|---|
function |
The Manage2 API function name. | reactivateLicense |
parameter |
The parameters that you pass to the function, in parameter=value format. |
"liscid" |
value |
The parameter’s value. | "12346" |
The cPanelLicensing Perl module
You can access Manage2 API functions via the cPanelLicensing
Perl module:
|
|
You must pass the username (for example, [email protected]
) and password (for example, 123456luggage
) to the module when you instantiate the Perl class.
This example uses the following variables:
Variable | Description | Example |
---|---|---|
function |
The Manage2 API function name. | reactivateLicense |
parameter |
The parameters that you pass to the function, in parameter=value format. |
'liscid' |
value |
The parameter’s value. | '12345' |
cURL
You can access Manage2 API functions via the cURL command line tool:
curl 'https://manage2.cpanel.net/XMLlicenseReActivate.cgi?output=json&liscid=12345'
You can also include the function and variables in separate strings, separated by the data (-d
) flag. For example:
curl 'https://manage2.cpanel.net/XMLlicenseReActivate.cgi' -d 'output=json&liscid=12345'
The system ignores any variables that you pass in the string before the -d
flag. For example:
curl 'https://manage2.cpanel.net/XMLlicenseReActivate.cgi?output=json' -d 'liscid=12345'
If you attempt to call the function in this format, the system ignores the output=json
variable.