Jump to content

asdasdqwe

Retired Forum Member
  • Posts

    1
  • Joined

  • Last visited

About asdasdqwe

asdasdqwe's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. <?php $url = "https://domain.com/includes/api.php"; # URL to WHMCS API file $username = "xxxx"; # Admin username goes here $password = "xxxx"; # Admin password goes here $postfields["action"] = "openticket"; $postfields["clientid"] = "545"; $postfields["subject"] = "API Ticket"; $postfields["message"] = "This is a sample ticket opened by the API"; $postfields["priority"] = "Low"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch); $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); print $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { # Result was OK! } else { # An error occured echo "The following error occured: ".$results["message"]; } ?> php sendemail.php errorAuthentication FailedThe following error occured: Authentication Failed[ username and password is correct. Don't know what is wrong
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated