Overview
With this screen you can try out cPanel API functions interactively.
- Only reseller accounts can use this screen.
- It supports just cPanel API 2 and UAPI functions.
The tool works on live server data. A function call can alter or remove data and may even make the server fail.
- Study the documentation of a function thoroughly before running it here.
- For sample output of a function, check its Response samples section in the cPanel Developer Documentation.
Enable the API Shell interface
Your hosting provider has to switch this feature on. They should do the following in WHM:
- Set cPanel & WHM API shell (for developers) to On in the System tab of Tweak Settings (WHM » Home » Server Configuration » Tweak Settings).
- Add the API Shell feature to your account's feature list in Feature Manager (WHM » Home » Packages » Feature Manager).
Call an API function
Run a function as follows:
- In the cPanel API version section, choose UAPI (API 3) or API 2.
- Pick the function from the menu for that version.
- In the Variables section, fill in the keys and values the function takes. Any required pairs must be supplied.
- Click Add to add another variable.
- Click the X icon to delete a variable.
- To filter, sort or paginate the output, click Show Sort/Filter/Paginate Options:
- To set which record the output starts from, type a number in the Index of first results to show, zero-based box or choose one from the menu.
- A value of
0shows unlimited results.
- A value of
- To cap the number of results, type a number in the Maximum # of results to show box or choose one from the menu.
- A value of
0shows unlimited results.
- A value of
- To filter, click Add under Filters. Choose the field, the condition (Contains, Begins With, Equals, Greater Than (numeric) or Less Than (numeric)) and the term to match.
- Click Add for an additional filter.
- Click the X icon to drop a filter.
- To sort, click Add under Sorts. Choose the field, the method (lexicographic, numeric, numeric_zero_as_max or ipv4) and whether to reverse the order.
- Click Add for an additional sort.
- Click the X icon to drop a sort.
- To restrict which columns appear, click Add under Columns and type the column number in the Column box.
- Click Add to show more columns.
- Click the X icon to remove a column.
- To set which record the output starts from, type a number in the Index of first results to show, zero-based box or choose one from the menu.
- Click Submit.
The URL and API call data structure sections update on their own as you change the function's values.
API call response
After Submit, the function's output appears in the API call response section. Switch between the Tree view, Table view and Raw view tabs to read it.
- In the Raw view tab, the response is shown apart from the HTTP headers.
- The Table view is not available for every kind of function data.
