Description

This function checks whether news is available on the server.

Examples 


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

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Determine whether news exists on the server.
$slime_icemachine = $cpanel->api2(
    'News', 'does_news_exist' 
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Determine whether news exists on the server.
my $slime_icemachine = $cpliveapi->api2(
    'News', 'does_news_exist' 
);

 

cpapi2 --user=username News does_news_exist

{
  "cpanelresult": {
    "apiversion": 2,
    "data": [
      1
    ],
    "func": "does_news_exist",
    "event": {
      "result": 1
    },
    "module": "News"
  }
}

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
reasonstring

A reason for failure.

This function only returns a value if it failed.

A string that describes the error.

This is an error message.
resultBoolean

Whether there is news available.

  • 1 — News available.
  • 0No news available.
1