API Shell for WHM

Valid for versions 82 through the latest version

Version:

82


Last modified: May 13, 2020

Overview

This feature allows you to call WHM API functions interactively within the interface. To enable this feature, you must enable the cPanel & WHM API shell (for developers) setting in WHM’s Tweak Settings interface (WHM >> Home >> Server Configuration>> Tweak Settings).

Warning:

This feature uses live data from your server. API function calls may change or delete data on your server, which can cause your server to fail. Read each function’s documentation thoroughly before you use it in the API Shell interface, a script, or through any other method.

Note:

Only the root user and root-enabled resellers may use this feature.

Call a WHM API 1 function

To call a WHM API function, perform the following steps:

  1. Select a version of the WHM API.

    Note:
    • Only WHM API version 1 is available through this interface.
    • To learn more about each function, click WHM API v1 Documentation.

  2. From the v1 menu, select the function that you wish to test.

  3. Enter the input parameters that you wish to test, and their values. To enter more parameters and values, click Add.

  4. To filter, sort, or paginate the results, click Show Sort/Filter/Paginate Options.

    • To select the first record to show from the results, enter a number in the Index (0-based) of first result to show text box.
    • To limit the number of results that the interface displays, enter the maximum number of results to display in the Maximum # of results to show text box.
    • To filter the results:
      1. Click Add in the Filters section.
      2. Enter the appropriate information in the Field text box, condition menu, and Term text box.
      3. To enter more filters, click Add.
    • To sort the results:
      1. Click Add in the Sorts section of the interface.
      2. Enter the appropriate information in the Field text box and condition menu.
      3. Select the Reverse checkbox if you want to reverse the sort order.
      4. To enter more sort methods, click Add.
    • To limit the columns to display:
      1. Click Add in the Columns section of the interface.
      2. Enter the appropriate information in the Column text box.
      3. To enter more columns to display, click Add.
  5. Click Submit.

API call results

The system displays the results in the API call response section of the interface. You can view the results in the Tree view, Table view, or Raw view tabs.

Note:

The Raw view tab’s response separates the function call’s response from the HTTP headers.

Additional Documentation