You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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

Description

This function returns a specific configuration key for a service. 

Examples


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


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)
{  
   "data":{  
      "mail_process_size":"512"
   },
   "metadata":{  
      "command":"get_service_config_key",
      "version":1,
      "reason":"OK",
      "result":1
   }
}
 Output (XML)
<result>
    <data>
        <mail_process_size>512</mail_process_size>
    </data>
    <metadata>
        <reason>OK</reason>
        <version>1</version>
        <result>1</result>
        <command>get_service_config_key</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
servicestring

Required

The service's name.

A valid cPanel & WHM service name in the /var/cpanel/conf directory.

dovecot
keystring

Required

The configuration key's name.

A valid configuration key for the service.

Note:

  • This parameter uses the key values in the /var/cpanel/conf/service/main file, where service is the service's name.
  • This function does not support subkeys.
mail_process_size

Returns

ReturnTypeDescriptionPossible valuesExample
key namestring

A configuration key's current setting.

Note:

This return's name is the value that you pass in this function's key parameter.

A valid setting.

512