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

 

Description

This function checks whether a user can access a particular feature.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/verify_user_has_feature?api.version=1&user=username&feature=sslinstall
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/verify_user_has_feature?api.version=1&user=username&feature=sslinstall
 Command Line
whmapi1 verify_user_has_feature user=username feature=featurename


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)
{  
   "metadata":{  
      "reason":"OK",
      "version":1,
      "command":"verify_user_has_feature",
      "result":1
   },
   "data":{  
      "query_feature":"sslinstall",
      "has_feature":1
   }
}
 Output (XML)
<result>
    <metadata>
        <result>1</result>
        <version>1</version>
        <reason>OK</reason>
        <command>verify_user_has_feature</command>
    </metadata>
    <data>
        <has_feature>1</has_feature>
        <query_feature>sslinstall</query_feature>
    </data>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample

user

string

Required

The user's username.

A valid cPanel username.username
featurestring

Required

The feature's name.


 

A valid feature name.

Note:

Call WHM API 1's get_feature_names function to view available features.

sslinstall

Returns

ReturnTypeDescriptionPossible valuesExample
query_featurestringThe feature's name.A valid feature name.sslinstall

has_feature

Boolean

Whether the user can access the feature.

  • 1 — The user can access the feature.
  • 0 — The user cannot access the feature.
 1