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

Unsuspend Account — unsuspendacct

This function will unsuspend a suspended account. When a user's account is unsuspended, he or she will be able to access cPanel again.

Calling Functions

Using the XML API

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

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

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

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

  • 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 unsuspendacct function takes the following required variable as input:

  • user (string) — Name of the user to unsuspend.

Output

  • unsuspendacct — Root-level XML tag for the output of the unsuspendacct function.
    • result — Container for the results of the function.
      • status (boolean) — Whether or not the operation succeeded.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Message related to the result of the operation.

Examples

XML API

Calling https://example.com:2087/xml-api/unsuspendacct?user=user123 in WebHost Manager will produce output similar to:

<unsuspendacct>
    <result>
        <status>1</status>
        <statusmsg>
            <script>if (self['clear_ui_status']) { clear_ui_status(); }</script>
            Changing shell for user123.
            Shell changed.
            Unlocking password for user user123.
            passwd: Success.
            Updating ftp passwords for user123
            Ftp password files updated.
            Ftp vhost passwords synced
            user123's account is now active
            Unsuspending mysql users
            Notification => admin@example.com via EMAIL [level => 3]
        </statusmsg>
    </result>
</unsuspendacct>

JSON API

Calling https://example.com:2087/json-api/unsuspendacct?user=user123 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"<script>if (self['clear_ui_status']) { clear_ui_status(); }</script>\n
Changing shell for user123.\nShell changed.\nUnlocking password for user user123
.\npasswd: Success.\nUpdating ftp passwords for user123\nFtp password files updated.
\nFtp vhost passwords synced\nuser123's account is now active\nUnsuspending mysql 
users\nNotification => admin@example.com via EMAIL [level => 3]\n"
      }
   ]
}

Topic revision: r5 - 29 Sep 2009 - 17:40:18 - MelanieSeibert