Child pages
  • Manage2 API - Authentication Methods
Skip to end of metadata
Go to start of metadata

Introduction

The Manage2 API supports HTTP or key-based authentication.

Manage2's client libraries use basic authentication over SSL by default. This method encodes the Manage2 username and password inside the HTTP request headers.

Authentication Methods

Basic Authentication

Basic Authentication encodes the Manage2 username and password inside the HTTP request headers.

When you call a Manage2 API script in a web browser, a dialog box will appear below the URL.

Enter the Manage2 username and password in the appropriate text boxes.

Use the curl -u command to authenticate user accounts when you call the function via the command line:

curl -u user@example.com:12345luggage https://manage2.cpanel.net/XMLgroupInfo.cgi

Use the cPanelLicensing Perl module to authenticate to the user account:

use cPanelLicensing;
my $cpl = cPanelLicensing->new(user => "user\@example.com", pass => "12345luggage");
$cpl->fetchGroups();

Use the require PHP class to authenticate to the user account:

require "cpl.inc.php";
$cpl = new cPanelLicensing("user\@example.com", "12345luggage");
$cpl->fetchGroups();

Key-Based Authentication

Key-based authentication grants access to a limited subset of the account's abilities without the account's username and password.

For security, the system limits keys to one IP address. You must register keys on the computer that runs the scripts.

To register a key, perform the following steps:

On subsequent API calls, pass this key as the apikey parameter's value:

curl 'https://manage2.cpanel.net/XMLlicenseInfo.cgi?output=json&apikey=aFj1fKnYzW5lbD5KXFeVtLsM'

Note:

If you use key-based authentication, the Manage2 API provides a Cross-Origin Resource Sharing (CORS) header. For more information, read W3's Cross-Origin Resource Sharing documentation.