Jump to content

Alexxxcfr

New Member
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alexxxcfr

  • Rank
    Junior Member
  1. Im getting the same problem, just null values. I added the ip addres under the security tab to allow it to connect using the API. This is my code. Thanks in advance.. <?php // API Connection Details $whmcsUrl = "mysystemurl"; $api_identifier = "identifierhere"; $api_secret = "secrethere"; $api_accesskey = "Apiaccesshere"; // Set post values $postfields = array( 'identifier' => $api_identifier, 'secret' => $api_secret, 'accesskey' => $api_accesskey, 'action' => 'GetTickets', 'responsetype' => 'json', ); // Call the API $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $whmcsUrl . 'includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); $response = curl_exec($ch); if (curl_error($ch)) { die('Unable to connect: ' . curl_errno($ch) . ' - ' . curl_error($ch)); echo "Voy a decode entrando aqui error"; } curl_close($ch); //print_r($results); // Decode response $jsonData = json_decode($response, true); // Dump array structure for inspection var_dump($jsonData); //echo $response; //var_dump($response); ?>
×
×
  • 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