ManageTwo
Manage2 User Guide
Logging In
Interface [+]
Interface [-]
Dashboard
Tabs
Shortcuts
Find
Welcome
Profile
Documentation
Feedback
Account Notes
Events
Licenses
Security
Billing
Company
Groups
Packages
Users
Direct
Support
Manage2 API Functions
Questions?
Documentation Home
RSS Feed
Documentation Home
>
ManageTwo
>
Manage2Api
E
dit
A
ttach
%ALIAS{name="functionname" value="<nop>XMLlookup.cgi"}% %STARTALIASAREA% ---+!! Look up a License ID — functionname %TOC% This Manage2 function allows you to retrieve the license ID associated with an IP address. ---++ Variables ---+++ Input The following variable is *required*: * *ip* (_string_) — The IP address that corresponds to the license ID you wish to retrieve. The following variables are *optional*: * *packageid* (_integer_) — The package that corresponds to the license ID you wish to retrieve. * *all* (_boolean_) — Whether to return all licenses currently associated with the specified IP address. (This parameter is intended for use with systems that have multiple licenses on a single IP address.) * =1= — yes * =0= — no (returns the first active license on the IP address) ---+++ Output * *licenseid* (_string_, or _list_ if =all=1= ) — The license ID(s) 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) %ALIAS{name="&inputvars" value="<nop>ip=127.0.0.1"}% %ALIAS{name="?inputvars" value="<nop>ip=127.0.0.1"}% Calling =http://manage2.cpanel.net/functionname?inputvars;all=1= in a web browser will produce XML output similar to the following: <blockquote> %CODE{ lang="html"}% <XMLlookup reason="OK" status="1"> <licenseid>5388377</licenseid> <licenseid>5388378</licenseid> </XMLlookup> %ENDCODE% </blockquote> %INCLUDE{ManageTwo.UsingHTTP}% ---+++ Using a Perl module The following is an example of a Perl module that will call =functionname=. 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. <blockquote> %CODE{ lang="perl"}% use cPanelLicensing; my $cpl = cPanelLicensing->new(user => $user, pass => $pass); my $licenses = $cpl->fetchLicenseId(ip => $ip); print "@$licenses\n"; %ENDCODE% </blockquote> In this example: * =$ip= is meant to stand for the IP address that corresponds to the license ID you wish to retrieve. * =$user= and =$pass= are meant to stand for your Manage2 account credentials. You can learn more about [[ManageTwo.UsingPerlModules][using a Perl module to call API functions]]. ---+++ Using a PHP class 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. <blockquote> %CODE{ lang="php" }% <?php include("cpl.inc.php"); $cpl = new cPanelLicensing($user, $pass); $licenses = $cpl->fetchLicenseId(array("ip" => $ip)); ?> %ENDCODE% </blockquote> In this example: * =$ip= is meant to stand for the IP address that corresponds to the license ID you wish to retrieve. * =$user= and =$pass= are meant to stand for your Manage2 account credentials. You can learn more about [[ManageTwo.UsingPHPClasses][using a PHP class to call API functions]]. %STOPALIASAREA% <!-- * Set PAGETITLE = Look up a License ID - XMLlookup.cgi -->
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r15
<
r14
<
r13
<
r12
<
r11
|
B
acklinks
|
V
iew topic
|
M
ore topic actions
Topic revision: r15 - 21 Feb 2013 - 19:54:29 - Main.ColinShannon
ManageTwo.XMLLookupID moved from Sandbox.XMLLookupID on 21 Jul 2009 - 19:11 by Main.JustinSchaefer
-
put it back
cPanel
cPanel & WHM
®
Website Owner
Hosting Providers
Data Center
System Admins
Developers
Community
News
Blog
Podcast
Videos
Forums
App Catalog
Events
Mailing Lists
Feature Requests
Plans & Pricing
Help
Documentation
English
EspaƱol