Child pages
  • WHM API 1 Functions - toggle_user_backup_state
Skip to end of metadata
Go to start of metadata

 

Description

This function enables or disables legacy backups for a user.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/toggle_user_backup_state?api.version=1&user=username&legacy=0
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/toggle_user_backup_state?api.version=1&user=username&legacy=0
 Command Line
whmapi1 toggle_user_backup_state user=username legacy=0


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "toggle_status": 0
  },
  "metadata": {
    "version": 1,
    "reason": "Backup state modified",
    "result": 1,
    "command": "toggle_user_backup_state"
  }
}
 Output (XML)
<result>
    <data>
        <toggle_status>0</toggle_status>
    </data>
    <metadata>
        <version>1</version>
        <reason>Backup state modified</reason>
        <result>1</result>
        <command>toggle_user_backup_state</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The user's username.

A valid username.
username
legacyBoolean

Whether the account should use the legacy backup system.

This value defaults to 0.

  • 1 — Use the legacy backup system.
  • 0 — Use the standard backup system.
0

Returns

ReturnTypeDescriptionPossible valuesExample
togglestatus Boolean Whether backups are active on the account.
  • 1 — Active.
  • 0 — Inactive.
0