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

Description


This function lists the features settings of cPanel accounts.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_users_features_settings?api.version=1&user-1=example&user-2=example2&feature-1=autossl&feature-2=webmail
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/get_users_features_settings?api.version=1&user-1=example&user-2=example2&feature-1=autossl&feature-2=webmail
 Command Line
whmapi1 get_users_features_settings user-1=example user-2=example2 feature-1=autossl feature-2=webmail


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)
{  
   "data": {
      "users_features_settings":[
      {
          "user":"example",
          "feature":"autossl",
          "feature_list":"examplefeaturelist",
          "feature_list_setting":1,
          "cpuser_setting":1
      },
      {
          "user":"example",
          "feature":"webmail",
          "feature_list":"examplefeaturelist",
          "feature_list_setting":1,
          "cpuser_setting":undef
      },
      {
          "user":"example2",
          "feature":"autossl",
          "feature_list":"default",
          "feature_list_setting":1,
          "cpuser_setting":1
      },
      {
          "user":"example2",
          "feature":"webmail",
          "feature_list":"default",
          "feature_list_setting":1,
          "cpuser_setting":undef
      }
   ]
},
   "metadata":{  
      "command":"get_users_features_settings",
      "version":1,
      "reason":"OK",
      "result":1
   }
}
 Output (XML)
<result>
    <data>
        <users_features_settings>
            <user>example</user>
            <feature>autossl</feature>
            <feature_list>examplefeaturelist</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <cpuser_setting>1</cpuser_setting>
         </users_features_settings>
        <users_features_settings>
            <user>example</user>
            <feature>webmail</feature>
            <feature_list>examplefeaturelist</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <reason>undef</reason>
         </users_features_settings>
        <users_features_settings>
            <user>example2</user>
            <feature>autossl</feature>
            <feature_list>default</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <cpuser_setting>1</cpuser_setting>
         </users_features_settings>
        <users_features_settings>
            <user>example2</user>
            <feature>webmail</feature>
            <feature_list>default</feature_list>
            <feature_list_setting>1</feature_list_setting>
            <reason>undef</reason>
         </users_features_settings>
    </data>
    <metadata>
        <result>1</result>
        <version>1</version>
        <reason>OK</reason>
        <command>get_users_features_settings</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The user's username.

Note:

To check multiple users, increment the parameter name. For example, user-1, user-2, and user-3.

A valid cPanel username that exists on the serverexample
featurestring

The feature's name.

Notes:

  • To check multiple features, increment the parameter name. For example, feature-1, feature-2, and feature-3.
  • If you use this parameter, you must enter a feature name, or the function returns an error.
  • If you do not use this parameter, the function returns data for all features on the server.
A valid feature name.autossl

Returns

ReturnTypeDescriptionPossible valuesExample
users_features_settings
array of hashes

An array of hashes that contains information about the feature list settings.

The array of hashes includes the user, feature, feature_list, feature_list_setting, and cpuser_setting returns. 

user

string

The user's username.

The function returns this value in the users_features_settings hash.

A valid cPanel username that exists on the server.

example

feature

string

The feature name.

The function returns this value in the   users_features_settings   hash.

A valid feature name.autossl

feature_list

string

The feature list's name.

The function returns this value in the   users_features_settings   hash.

A valid feature list's name.default

feature_list_setting

Boolean

The user's feature list setting.

The function returns this value in the   users_features_settings   hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

cpuser_setting

Boolean

The user's setting for the feature in their cpuser file, which overrides the feature_list_setting return.

The function returns this value in the   users_features_settings   hash.

  • 1 — Enabled.
  • 0 — Disabled.
  • undef — The feature is not defined in the feature list.
1