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

Description


This function retrieves the value of a non-volatile variable. cPanel NVData is a per-account configuration storage mechanism that you can use to maintain persistent cPanel & WHM settings across multiple sessions. This includes custom settings for your own themes.

Note:

We deprecated this function in cPanel & WHM version 74. Instead, we recommend that you use the WHM API 1 Functions - personalization_get function.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/nvget?api.version=1&key=ThermalDetonator
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/nvget?api.version=1&key=ThermalDetonator
 Command Line
whmapi1 nvget key=ThermalDetonator


Notes:

  • 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. 

 Output (JSON)
{
  "data": {
    "nvdatum": {
      "value": [
        "Active"
      ],
      "key": "ThermalDetonator"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "nvget"
  }
}
 Output (XML)
<result>
    <data>
        <nvdatum>
            <value>Active</value>
            <key>ThermalDetonator</key>
        </nvdatum>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>nvget</command>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
keystring

Required

The variable's name.

A valid string.

ThermalDetonator

Returns

ReturnTypeDescriptionPossible valuesExample
nvdatumhash

A hash of the variable's information.

This hash includes the data from the value array and key return. 

value

array

The variable's value.

This function returns this value in the nvdatum hash.

A valid list of strings.
Active

key

string

The variable's name.

This function returns this value in the nvdatum hash.

A valid string.
ThermalDetonator