Last modified November 21, 2024

Common

JetBackup API Parameters

jetbackup5api backup -F listBackups -D "type=127" -O json
Part Description
Function
The JetBackup API function.
-F/--func FUNCTION_NAME
Data
The parameters you want to pass to the API call.
-D/--data "PARAM_NAME=PARAM_VALUE&...&PARAM_NAME=PARAM_VALUE"
Output format
The output format you want the API call to be returned as.
-O/--output json/plain

List Parameters

These are the available parameters you can pass to all the list API calls.

Parameter name Value Description Possible values Example
limit Integer Limit the specified number of records returned.   10
skip Integer Skip the specified number of records returned.   2
sort[] List The value you want to sort by.
  • 1 : ascending order
  • -1 : descending order
sort[type]=1

How To Retrieve API Keys/Tokens

cPanel

To create an API token in cPanel, use WHM’s Manage API Tokens interface (WHM > Home > Development > Manage API Tokens).

  1. Click on the ‘Generate Token’ button.
  2. Enter the token name.
  3. Choose the privileges you would like to provision for your script(s).
  4. Make sure to check the ‘Third Party Services Additional Software - JetBackup software-JetBackup’.
  5. Hit the ‘save’ button.
  6. Copy the token generated and store in a safe place.

For more information about cPanel API tokens, click here.

DirectAdmin

To create an API Login Key in DirectAdmin, use WCP’s Login Keys interface (WCP > User Level > Login Keys).

  1. Click on the “CREATE” Login Key button
  2. Enter the Key Name.
  3. Specify a Key Value, or use the random button for a longer value.
  4. Choose the Commands you would like to provision for your script(s).
  5. Hit the ‘CREATE’ button.
  6. Copy the key generated and store in a safe place.

For more information about DirectAdmin API Login Keys, click here.

Once your key/token is generated, include that API key/token in your custom code.

Linux

To create an API Access Token in Linux (Standalone) servers, navigate to JB5 > Settings > Panel:

  1. Click on the “Create new Access Token”
  2. Enter description, IP Address, and assign the Account(s) that will be allowed access to the API. Leaving this field empty will allow all users to access using the access token.
  3. Copy the token generated and store in a safe place.

For more infomration about JetBackup Linux Access Tokens, click here

Plesk

To create an API Key in Plesk, use the secret_key utility.

  1. Run the following command and replace the $IP_ADDRESS field with your server IP address:
    • plesk bin secret_key -c -ip-address {$IP_ADDRESS}
  2. You should receive a key in the output:
    • 4897e11f-d053-0f83-1ac0-38b3822cfba8
  3. Copy the API key and store it in a safe place.

Alternatively, you may create an API key in Plesk by sending a POST request:

  1. Create an API key. Replace root:password with your user credentials and $IP_ADDRESS with your Plesk server IP address.
    • curl -X POST --user root:password -H "Content-Type: application/json" -H "Accept: application/json" -d'{}' "https://{$IP_ADDRESS}:8443/api/v2/auth/keys"
  2. This should output the key.
    • {"key":"4897e11f-d053-0f83-1ac0-38b3822cfba8"}
  3. Copy the API key and store it in a safe place.

For more information about Plesk API Keys, click here