Look up a License ID — XMLlookup.cgi

This Manage2 function allows you to retrieve the license ID associated with an IP address.

Variables

Input

  • ip (string) — The IP address that corresponds to the license ID you wish to retrieve.

Output

  • licenseid (string) — The license ID associated with the IP address.
    • Example: 0001
  • reason (string) — Information about the license ID lookup.
  • status (boolean) — Whether the lookup was successful.
    • 1 — The license was successfully looked up.
    • 0 — The license does not exist.
    • -1 — The request failed due to an error.
  • version (float) — Internal information used by the Manage2 API.

Examples

Using HTTP (direct API call)

Show Hide

Calling http://manage2.cpanel.net/XMLlookup.cgi?ip=127.0.0.1 in a web browser will produce XML output similar to the following:

<XMLlookup licenseid="000001" reason="OK" status="1" version="1"/>

Calling the function using the URL above will return XML data by default. To change the output format that will be returned, use either of the following URLs:

  • JSONhttp://manage2.cpanel.net/XMLlookup.cgi?output=json&ip=127.0.0.1
  • YAMLhttp://manage2.cpanel.net/XMLlookup.cgi?output=yaml&ip=127.0.0.1
For more information about each of these output types, visit our Choosing an Output Type documentation.

Using a Perl module

Show Hide

The following is an example of a Perl module that will call XMLlookup.cgi. You can use this module to pass input variables to a Manage2 API function. You may need to edit the example below to suit your needs.

use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
    $cpl->fetchLicenseId(
ip=>$ip
)

In this example, $ip is meant to stand for the IP address that corresponds to the license ID you wish to retrieve.

For more information about using a Perl module to call API functions, visit our page here.

Using a PHP class

Show Hide

The following is an example showing how to call the cPanelLicensing PHP class. You can use this class to pass input variables to the Manage2 API using a few short calls.

<?php

include("cpl.inc.php");

$cpl = new cPanelLicensing("__USERNAME__","__PASSWORD__");
$lisc = $cpl->fetchLicenseId(array(
		"ip" => $ip
	)
);

?>

In this example, $ip is meant to stand for the IP address that corresponds to the license ID you wish to retrieve.

PICK Remember: __USERNAME__ and __PASSWORD__ are meant to represent the username and password for your Manage2 account.

For more information about using a PHP class to call API functions, visit our page here.

Edit | Attach | Print version | History: r15 | r13 < r12 < r11 < r10 | Backlinks | Raw View | More topic actions...
Topic revision: r11 - 20 Apr 2011 - 14:30:53 - MelanieSeibert
ManageTwo.XMLLookupID moved from Sandbox.XMLLookupID on 21 Jul 2009 - 19:11 by Main.JustinSchaefer - put it back