We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

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

Description

This function returns the daily interface use of cPanel API 1 functions. This is useful, for example, to find out which API calls your custom interfaces or third-party plugins use.

Important:

The function only returns cPanel API 1 functions. We deprecated cPanel API 1 and plan to remove those functions at a later date. For more information, read our Guide to Replacing cPanel API 1 Functions with UAPI Equivalents documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_api_pages?api.version=1&type=cpapi1
 Command Line
whmapi1 get_api_pages type=cpapi1


Notes:

  • Unless otherwise noted, 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)
{
	"metadata": {
		"result": 1,
		"reason": "OK",
		"command": "get_api_pages",
		"version": 1
	},
	"data": {
		"result": [{
				"count": 200000,
				"timestamp": 1548828000,
				"entry": "/usr/local/cpanel/base/frontend/paper_lantern/plugin1/child.html.tt"
			},
			{
				"entry": "/usr/local/cpanel/base/frontend/paper_lantern/plugin1/index.html.tt",
				"timestamp": 1548828000,
				"count": 200000
			}
		]
	}
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
type string

The cPanel API type to query.

This parameter defaults to cpapi1.

cpapi1 is the only possible value.

cpapi1 

Returns

ReturnTypeDescriptionPossible valuesExample
entry stringThe path to the file where the function executes.

A valid absolute file path.

/usr/local/cpanel/base/frontend/paper_lantern/plugin1/index.html.tt
count integerThe total number of times that the system called the function on the day in the timestamp return.An integer value.200000
timestamp integerThe date that the system called the function. 

A date, in Unix time format.

Note:

This value does not include time.

1548828000