zontrakulla Posted December 23, 2013 Share Posted December 23, 2013 Hello, I'm using whmcs api in a custom php script. I can add clients and order products. However i can't get orders. $url = "https://www.mysite.com/includes/api.php"; # URL to WHMCS API file $postfields["username"] = "adminusername"; $postfields["password"] = md5("adminpassword"); $postfields["action"] = "getorders"; $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); $results[$temp[0]] = $temp[1]; } if ($results["result"]=="success") { # Result was OK! } else { # An error occured echo "The following error occured: ".$results["message"]; } I'm getting The following error occured: no details. Why is that happening? 0 Quote Link to comment Share on other sites More sharing options...
zontrakulla Posted December 31, 2013 Author Share Posted December 31, 2013 Anyone, please?! 0 Quote Link to comment Share on other sites More sharing options...
JoshDargie Posted January 1, 2014 Share Posted January 1, 2014 Your likely filtering out the response with the: $data = explode(";",$data); foreach ($data AS $temp) { $temp = explode("=",$temp); $results[$temp[0]] = $temp[1]; } Error log $data just after the curl_close($ch)... This will give you an exact response from the server before anything filtered it. One thing I've found in building a completely unique client area based on WHMCS & Kayako API's is WHMCS's apis are unreliable. To many times the documentation doesn't match the calls required, so its a bit of trial and error. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.