Description

This function checks whether the account's contact option is enabled.

We strongly recommend that you use the following UAPI function instead of this function:

Examples 


https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Contactus&cpanel_jsonapi_func=isenabled

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Determine whether contact option is enabled on account
$contact_enabled = $cpanel->api2(
    'Contactus', 'isenabled'
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Determine whether contact option is enabled on account
my $contact_enabled = $cpliveapi->api2(
    'Contactus', 'isenabled'
);

 

cpapi2 --user=username Contactus isenabled

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "isenabled",
    "data": [
      {
        "enabled": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Contactus"
  }
}

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible ValuesExample

enabled

Boolean

Whether the contact option is enabled.

  • 1 — Enabled.
  • 0 — Disabled.
1
reasonstring

A reason for failure.

This function only returns a reason value if it failed.

A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1