Description

This function retrieves the account's notification settings.

 

 

Examples 


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

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the notification settings.
$save_contact = $cpanel->api2(
    'CustInfo', 'contactprefs'
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Retrieve the notification settings.
my $save_contact = $cpliveapi->api2(
    'CustInfo', 'contactprefs',
);

 

cpapi2 --user=username CustInfo contactprefs

 {  
   "cpanelresult":{  
      "apiversion":2,
      "func":"contactprefs",
      "data":[  
         {  
            "value":1,
            "onchangeparent":"",
            "name":"notify_contact_address_change",
            "descp":"My contact email address changes.",
            "type":"Boolean",
            "enabled":1
         },
         {  
            "value":1,
            "onchangeparent":"notify_contact_address_change",
            "name":"notify_contact_address_change_notification_disabled",
            "descp":"My preference for contact email address change notifications is disabled.",
            "type":"Boolean",
            "enabled":1
         },
         {  
            "value":1,
            "onchangeparent":"",
            "name":"notify_disk_limit",
            "descp":"My account approaches its disk quota.",
            "type":"Boolean",
            "enabled":1
         },
         {  
            "value":1,
            "onchangeparent":"",
            "name":"notify_bandwidth_limit",
            "descp":"My account approaches its bandwidth usage limit.",
            "type":"Boolean",
            "enabled":1
         },
         {  
            "value":1,
            "onchangeparent":"",
            "name":"notify_email_quota_limit",
            "descp":"Any of my account's email accounts approaches or is over quota.",
            "type":"Boolean",
            "enabled":1
         },
         {  
            "value":1,
            "onchangeparent":"",
            "name":"notify_password_change",
            "descp":"My account's password changes.",
            "type":"Boolean",
            "enabled":1
         },
         {  
            "value":1,
            "onchangeparent":"notify_password_change",
            "name":"notify_password_change_notification_disabled",
            "descp":"My preference for account password change notifications is disabled.",
            "type":"Boolean",
            "enabled":1
         }
      ],
      "event":{  
         "result":1
      },
      "module":"CustInfo"
   }
}

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
enabledBooleanWhether the notification setting is enabled.
  • 1 — The setting is enabled.
  • 0 — The setting is disabled.

 

1
onchangeparentstringThe notification setting to monitor.
  • notify_password_change
  • notify_contact_address_change

notify_password_change

valuestringThe notification setting's value.
  • 1 — The setting is enabled.
  • 0 — The setting is disabled.
1
typestringThe notification setting's data type.
  • Boolean
  • string
Boolean
descpstringA notification setting's description.A string value.
My contact email address changes.
namestringThe notification setting's name.A string value.
notify_disk_limit
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