Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Add Reseller Privileges — setupreseller

This function gives reseller status to an account.

note Note: The user must already exist to be made a reseller. This function will not create an account. If the account does not yet exist, you can use the createacct function to set it up before conferring reseller privileges.

Calling Functions

Using the XML API

To use the XML API to perform the setupreseller function from within your custom script:

  • Append the /xml-api/setupreseller function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/setupreseller

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the setupreseller function from within your custom script:

  • Append the /json-api/setupreseller function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/setupreseller

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The setupreseller function takes the following variables as input.

The following variable is required:

  • user — Name of the user to whom you wish to give reseller status.

The following variable is optional:

  • makeowner — Whether or not the reseller will own his or her own account.
    ALERT! Warning: Users who own their accounts are able to modify them. This will allow them to circumvent account creation limits you may have set up.
    • 1 — yes.
    • 0 — no.

Output

  • setupreseller — Root-level XML tag for the output of the setupreseller function.
    • result — Container for the results of the reseller setup function.
      • status (boolean) — Whether or not the operation succeeded.
        • 1 — yes.
        • 0 — no.
      • statusmsg (string) — Message about the result of the operation.

Examples

XML API

Calling the URL https://example.com:2087/xml-api/setupreseller?user=bob&makeowner=1 in WebHost Manager will produce output similar to:

<setupreseller>
      <result>
            <status>1</status>
            <statusmsg/>
      </result>
</setupreseller>

JSON API

Calling the URL https://example.com:2087/json-api/setupreseller?user=bob&makeowner=1 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":null
      }
   ]
}

Topic revision: r6 - 29 Sep 2009 - 17:59:49 - MelanieSeibert