Manage2 API

The Manage2 API allows you to automate certain procedures surrounding license management. Most often, you will create a script that utilizes our Manage2 API to retrieve and manipulate licensing information. This allows you to build a customizable interface or simplify license management to the simple execution of a script through a browser.

The Manage2 API allows you to retrieve information using 3 formats. You may use:

  • XML — For more information, you can visit the Wikipedia article on XML here.
    • note Note: XML is output by default. To change the output, see our section on formatting API calls below.
  • JSON — For more information, you can visit the Wikipedia article on JSON here.
  • YAML — For more information, you can visit the Wikipedia article on YAML here.

Each of these API functions can be called through get or post HTTP calls. We strongly recommend that you use a post HTTP call.

Formatting and using API calls

Using a web browser

Each XML, JSON, and YAML API call can be formatted as a URL. To create a function call:

  • Begin with the HTTP address of Manage2.
    • http://manage2.cpanel.net
  • To call the script, simply type the function name after the web address.
    • Example: http://manage2.cpanel.net/XMLlicenseInfo.cgi (where XMLlicenseInfo.cgi is the name of the function being called).
  • The XML output format will be used by default. To change the output format, you will need to pass the output parameter to the function being called.
    Examples:
    • JSONhttp://manage2.cpanel.net/XMLlicenseInfo.cgi?output=json
    • YAMLhttp://manage2.cpanel.net/XMLlicenseInfo.cgi?output=yaml
  • PICK Remember: You need to be logged in with the proper permissions in order to call a function. Simply add the IP address from which you are calling the function to your Manage2 profile using the Add an access IP function.

Using a Perl Module

Our Manage2 API Licensing Modules allow you to perform license functions directly, bypassing the cPanel Manage2 web interface from within a perl script. Using them, you can work with your customers’ cPanel licenses through the command line interface, or allow others to modify their licenses through your own custom graphical interface.

  • For more information, you can visit our documentation here.

Using a PHP Class

The PHP cPanelLicensing class simplifies development of automated cPanel License provisioning. This class requires PHP5 with curl support and SimpleXML support (which is on by default). This class returns SimpleXML objects by default; however, it can be configured to return XML, JSON, or YAML.

note Note: SimpleXML is a feature of PHP5 that allows XML to easily be transformed into data structures similar to associative arrays.

  • For information about using a PHP class to call Manage2 API functions, visit our documentation here.

Functions

note Note: Many of the functions below take license, group, and package IDs as input. You can obtain these variables from the output of other API calls. However, when you use the IDs as input variables, they are not exactly the same as the output returned by another API function. As you will see, the IDs are often prefixed by a letter when they are output. In order to use these IDs as input, you will need to remove the initial letter so that, for example, G10001 will become 10001.

Reactivate Licenses ( XMLlicenseReActivate.cgi) — This function reactivates expired licenses.

Expire Licenses ( XMLlicenseExpire.cgi) — This function expires existing licenses.

Change a License's IP ( XMLtransfer.cgi) — This function will change the IP address associated with a particular license. This is useful if you wish transfer a license to a new server.

Request a License Transfer ( XMLtransferRequest.cgi) — This function allows you to request a license be transferred from one company to another.

Add Licenses ( XMLlicenseAdd.cgi) — This function allows you to purchase and add a new license to your Manage2 account.

Display Groups ( XMLgroupInfo.cgi) — This function will list all of the groups associated with your Manage2 account.

Raw Lookup ( XMLRawLookup.cgi) — This function will list all of the license information associated with a specific IP address.

Look up License ID ( XMLlookup.cgi) — This function allows you to look up a license ID using an IP address.

List Package Information ( XMLpackageInfo.cgi) — This function will retrieve and display a list of packages that are available to your Manage2 account.

List License Information ( XMLlicenseInfo.cgi) — Get a list of all licenses in your account.

Extend One Time Licenses ( XMLonetimeext.cgi) — This function allows you to extend a one time license.

Fetch Risk Data ( XMLsecverify.cgi) — This function allows you fetch the estimated probability of fraud risk associated with an IP address.

Topic revision: r9 - 28 Sep 2009 - 05:06:26 - Main.JNickKoston
ManageTwo.Manage2Api moved from Sandbox.Manage2Api on 21 Jul 2009 - 19:09 by Main.JustinSchaefer - put it back
 

Copyright © cPanel 2000-2009.