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

Suspend a Reseller Account — suspendreseller

This function will allow you to suspend a reseller's account. The suspension will prevent the reseller from accessing his or her account.

Calling Functions

Using the XML API

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

  • Append the /xml-api/suspendreseller 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/suspendreseller

  • 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 suspendreseller function from within your custom script:

  • Append the /json-api/suspendreseller 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/suspendreseller

  • 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 suspendreseller function takes the following variables as input.

The following variable is required:

  • user (string) — Username of the reseller to suspend.

The following variable is optional:

  • reason(string) — Reason for the suspension.
  • disallow(boolean) — This value determines whether resellers are allowed to unsuspend the account. This parameter is only available in version 11.40+.
    • 1 — Resellers will be unable to unsuspend the account. Only root or root -enabled resellers will be able to unsuspend the reseller.
    • 0 — Resellers will be able to unsuspend the account.

Output

Show Hide

  • suspendreseller — Root-level XML tag for the output of the suspendreseller function.
    • output (string) — An explanation of the actions taken during the suspension.
    • result — Container for the results of the function.
      • status (boolean) — The status of the request.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Additional information about the status of the request.

Examples

XML API

Show Hide

Calling https://example.com/xml-api/suspendreseller?user=user123&reason=Late%20Payments in WebHost Manager will produce output similar to:

<suspendreseller>
     <output>
        Changing Shell to /bin/false...Changing shell for user123.
        Warning: "/bin/false" is not listed in /etc/shells
        Shell changed.
        Done
        Locking Password...Locking password for user user123.
        passwd: Success
        Done
        Suspending mysql users
        Notification => admin@example.com via EMAIL [level => 3]
        Using Quota v3 Support
        Suspended document root /home/user123/public_html
        Using Quota v3 Support
        Suspending FTP accounts...
        Updating ftp passwords for user123
        Ftp password files updated.
        Ftp vhost passwords synced
        user123's account has been suspended
      </output>
      <result>
              <status>1</status>
              <statusmsg>Finished suspending reseller.</statusmsg>
      </result>
</suspendreseller>

JSON API

Show Hide

Calling https://example.com:2087/json-api/suspendreseller?user=user123&reason=Late%20Payments in WebHost Manager will produce something similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Finished suspending reseller."
      }
   ],
   "output":"Changing Shell to /bin/false...Changing shell for user123.\nWarning: 
\"/bin/false\" is not listed in /etc/shells\nShell changed.\nDone\nLocking Password...
Locking password for user user123.\npasswd: Success\nDone\nSuspending mysql 
users\nNotification => admin@example.com via EMAIL [level => 3]\nUsing Quota v3 
Support\nSuspended document root /home/user123/public_html\nUsing Quota v3 
Support\nSuspending FTP accounts...\nUpdating ftp passwords for user123\nFtp 
password files updated.\nFtp vhost passwords synced\nuser123's account has been 
suspended\n"
}

Topic revision: r5 - 10 Oct 2013 - 21:42:23 - Main.LaurenceSimon