Description

This function sends a support request to the site's host.

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=sendcontact&email=laurence%40cpanel.net&issue=It%20smells%20awful.&subject=My%20dog%20has%20no%20nose.

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Send a support request to your host.
$send_request = $cpanel->api2(
    'Contactus', 'sendcontact', 
    array(
          email => 'username@example.com',
          subject => 'My dog has no nose.',
          issue => 'It smells awful.',
    ) 
);

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Send a support request to your host.
my $send_request = $cpliveapi->api2(
    'Contactus', 'sendcontact',
    { 
     email => 'username@example.com',
     subject => 'My dog has no nose.',
     issue => 'It smells awful.',
    }
);

 

 
cpapi2 --user=username Contactus sendcontact email=username%40example.com subject="My dog has no nose." issue="It smells awful."

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
emailstring

Required

The sender's contact email address.

A valid email address.

 

username@example.com
issuestring

Required

The support request's message body.

A valid string.It smells awful.
subjectstring

Required

The support request's subject line.

A valid string.My dog has no nose.

Returns

ParameterTypeDescriptionPossible valuesExample
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