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

 

Description

This function creates or updates a feature list.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/update_featurelist?api.version=1&featurelist=TheBlackLagoon&autoresponders=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/update_featurelist?api.version=1&featurelist=TheBlackLagoon&autoresponders=1
 Command Line
whmapi1 update_featurelist featurelist=TheBlackLagoon autoresponders=1


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": {
        "invalid_features": [],
        "featurelist": "TheBlackLagoon",
        "updated_features": {
            "autoresponders": "1"
        }
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "update_featurelist"
    }
}
 Output (XML)
<result>
    <data>
        <featurelist>TheBlackLagoon</featurelist>
            <updated_features>
                <autoresponders>1</autoresponders>
            </updated_features>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>update_featurelist</command>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample

featurelist

string

Required

The feature list's name.

A valid string.TheBlackLagoon
feature nameBoolean

Whether to include the feature in the feature list.

Notes:

  • This parameter's name is the feature's name.
  • If you do not specify any features, the system will disable all features in the feature list.
  • 1 — Include.
  • 0 — Do not include.

Note:

1

Returns

ReturnTypeDescriptionPossible valuesExample
invalid_featuresarrayAn array of invalid feature names.This array includes the invalid feature return. 

invalid feature

Boolean

Whether the feature exists in the feature list.

Note:

The feature's name is the return's name.

The function returns this value in the invalid_features array.

  • 1 — The feature exists in the feature list.
  • 0 — The feature does not exist in the feature list.
1

featurelist

stringThe feature list's name.A valid string.TheBlackLagoon

updated_features

hash

A hash of features in the feature list.

This hash includes the feature name return. 

feature name

Boolean

Whether the feature exists in the feature list.

Note:

The feature's name is the return's name.

The function returns this value in the updated_features hash.

  • 1 — The feature exists in the feature list.
  • 0 — The feature does not exist in the feature list.
 1