UAPI Functions - Features::has_feature

Description

This function checks whether an account has a feature installed.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Features/has_feature?name=fantastico

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Does the account have the feature "fantastico" ?
$Features_has_feature $cpanel->uapi(
    'Features''has_features',    array(
        'name'    => 'fantastico',
    )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Does the account have the feature "fantastico" ?
my $Features_has_feature $cpliveapi->uapi(
    'Features''has_feature',    {
        'name'    => 'fantastico',
    }
);

 cPanel Template Toolkit

<!-- Does the account have the feature "fantastico" ? -->
[% data = execute( 'Features', 'has_feature', { name => 'fantastico'}  ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 Command Line

uapi --user=username Features has_feature name=fantastico

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

If the feature does not exist:

1
2
3
4
5
6
7
8
9
10
11
{
  "messages": [
    null
  ],
  "errors": null,
  "status": 0,
  "metadata": {
     
  },
  "data": null
}

If the feature exists and is enabled:

1
2
3
4
5
6
7
8
9
10
11
{
  "messages": [
    null
  ],
  "errors": null,
  "status": 1,
  "metadata": {
     
  },
  "data": null
}

If the feature exists and is not enabled:

1
2
3
4
5
6
7
8
9
10
11
{
  "messages": [
    "The feature "fantastico" exists but is not enabled."
  ],
  "errors": null,
  "status": 0,
  "metadata": {
     
  },
  "data": null
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

 Parameter 

Type

Description

 Possible values 

 Example 

name

 string 

 The feature's name. 

A valid string.

fantastico

 

Returns

Note:

The function returns a hash of boolean values that use the name of each feature that is available to the account, and whether they are installed. 

Return

Type

Description

Possible values

Example

 messages 

 string 

 Whether the feature exists and is installed. 

  • A localized confirmation message. 
  • A null value.

 The feature "fantastico" exists but is not enabled. 

             

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....