Add a Pickup Passphrase — XMLaddPickupPass.cgi

This Manage2 function creates a password or phrase that XMLregisterAuth can then use to obtain a key for authenticating with the API.

You can use this key to create your own applications with limited access to the API, and distribute them to people who should not have full access to your Manage2 account.

Variables

Input

  • pickup (string) — The pickup passphrase you wish to add.

Output

  • reason (string) — Information about adding the pickup passphrase.
  • status (integer) — Describes whether adding the pickup passphrase was successful.
    • 1 — The passphrase has been successfully added.
    • 0 — The request failed.
    • -1 — The input was invalid.

Examples

Using HTTP (direct API call)

Show Hide

Calling https://manage2.cpanel.net/XMLaddPickupPass.cgi?pickup=hello+world in a web browser will produce XML output similar to the following:

<XMLaddPickupPass
    reason="Successfully added pickup phrase 'hello world!' for joe@example.com"
    status="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/XMLaddPickupPass.cgi?output=json&pickup=hello+world
  • YAMLhttp://manage2.cpanel.net/XMLaddPickupPass.cgi?output=yaml&pickup=hello+world
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 XMLaddPickupPass.cgi. You can use this module to pass input variables to a Manage2 API function.

use cPanelLicensing;
my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
$cpl->addPickupPass(pickup => $pickup); 

You can learn more about using a Perl module to call API functions.

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($user, $pass);
$cpl->addPickupPass(array("pickup" => $pickup));
?>

You can learn more about using a PHP class to call API functions.

Topic revision: r5 - 21 Feb 2013 - 19:16:58 - Main.ColinShannon