Development Guides Home >> Guide to the LiveAPI System >> LiveAPI Methods
The fetch() method is a wrapper to return a hash reference from the cpanelprint() function, which retrieves a cPanel variable.
- We deprecated this method.
- To return a data result for a cPanel variable's value, use the
cpanelprint()method.
// Get a hashref of the cPanel account's username.
$cpanel->fetch('$user');# Get a hashref of the cPanel account's username.
$cpliveapi->fetch('$user');| Parameter | Type | Description | Possible values | Example |
|---|---|---|---|---|
variable | string | A cPanel variable. | A valid cPanel variable. For a full list of cPanel variables, read our Guide to cPanel Variables documentation. | $user |
This method returns the cPanel variable's value as a hash reference.