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

 

Description

This function sets the value for a service's configuration key.

Examples


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


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.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{  
   "metadata":{  
      "command":"set_service_config_key",
      "result":1,
      "reason":"Succeeded",
      "version":1
   }
}
 Output (XML)
<result>
    <metadata>
        <command>set_service_config_key</command>
        <result>1</result>
        <version>1</version>
        <reason>Succeeded</reason>
    </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 with a .main configuration file in the /var/cpanel/conf directory.

Warning:

As of cPanel & WHM version 58, only the dovecot service is compatible with this function.

dovecot
keystring

Required

The configuration key's name.

A valid configuration key for the service.

Note:

This function currently only supports top-level configuration keys and not subkeys.

mail_process_size
valuevaries

Required

The new value for the configuration key.

A valid string or integer, depending on the service and key.256

Returns

This function only returns metadata.