
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
Look up a License ID — XMLlookup.cgi | ||||||||
| Deleted: | ||||||||
| < < | This Manage2 function allows you to retrieve the license ID associated with an IP address. | |||||||
| Added: | ||||||||
| > > | This Manage2 function allows you to retrieve the license ID associated with an IP address. | |||||||
VariablesInput | ||||||||
| Changed: | ||||||||
| < < |
| |||||||
| > > | The following variable is required:
| |||||||
Output | ||||||||
| Changed: | ||||||||
| < < |
| |||||||
| > > |
| |||||||
| ||||||||
| Changed: | ||||||||
| < < |
| |||||||
| > > |
| |||||||
| ||||||||
| Changed: | ||||||||
| < < |
| |||||||
| > > |
| |||||||
Examples | ||||||||
| Line: 32 to 39 | ||||||||
| Changed: | ||||||||
| < < |
Show Hide <--/twistyPlugin twikiMakeVisibleInline-->
Calling http://manage2.cpanel.net/XMLlookup.cgi?ip=127.0.0.1 in a web browser will produce XML output similar to the following: | |||||||
| > > | Calling http://manage2.cpanel.net/XMLlookup.cgi?ip=127.0.0.1;all=1 in a web browser will produce XML output similar to the following: | |||||||
%CODE{ lang="html"}% | ||||||||
| Changed: | ||||||||
| < < | ||||||||
| > > | | |||||||
%ENDCODE%
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:
| ||||||||
| Deleted: | ||||||||
| < < | <--/twistyPlugin--> | |||||||
Using a Perl module | ||||||||
| Deleted: | ||||||||
| < < |
Show Hide <--/twistyPlugin twikiMakeVisibleInline--> | |||||||
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.
| ||||||||
| Line: 65 to 61 | ||||||||
| use cPanelLicensing; my $cpl = cPanelLicensing->new(user => $user, pass => $pass); | ||||||||
| Changed: | ||||||||
| < < | $cpl->fetchLicenseId( ip=>$ip ) | |||||||
| > > | my $licenses = $cpl->fetchLicenseId(ip => $ip); print "@$licenses\n"; | |||||||
| %ENDCODE% | ||||||||
| Changed: | ||||||||
| < < | In this example, $ip is meant to stand for the IP address that corresponds to the license ID you wish to retrieve. | |||||||
| > > | In this example:
| |||||||
| You can learn more about using a Perl module to call API functions. | ||||||||
| Deleted: | ||||||||
| < < | <--/twistyPlugin--> | |||||||
Using a PHP class | ||||||||
| Deleted: | ||||||||
| < < |
Show Hide <--/twistyPlugin twikiMakeVisibleInline--> | |||||||
| 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. | ||||||||
| Line: 91 to 80 | ||||||||
%CODE{ lang="php" }% <?php | ||||||||
| Deleted: | ||||||||
| < < | ||||||||
| include("cpl.inc.php"); | ||||||||
| Changed: | ||||||||
| < < | $cpl = new cPanelLicensing("__USERNAME__","__PASSWORD__"); $lisc = $cpl->fetchLicenseId(array( "ip" => $ip ) ); | |||||||
| > > | $cpl = new cPanelLicensing($user, $pass); $licenses = $cpl->fetchLicenseId(array("ip" => $ip)); | |||||||
| ?> %ENDCODE% | ||||||||
| Changed: | ||||||||
| < < | In this example, $ip is meant to stand for the IP address that corresponds to the license ID you wish to retrieve.
__USERNAME__ and __PASSWORD__ are meant to represent the username and password for your Manage2 account. | |||||||
| > > | In this example:
| |||||||
| You can learn more about using a PHP class to call API functions. | ||||||||
| Deleted: | ||||||||
| < < | <--/twistyPlugin--> | |||||||
|
View topic | History: r15 < r14 < r13 < r12 | More topic actions... | ||||||||