Fusionbird Posted March 17, 2010 Share Posted March 17, 2010 HI all, Can any one help me for solving the issue I'm getting while doing the API integration for the Add Client . I'm getting the error like " The following error occured: Authentication Failed ". Can any one figure out the reason why I'm getting like this. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted March 17, 2010 WHMCS Support Manager Share Posted March 17, 2010 Have you allowed your server's IP access to the API? Setup > General Settings > Security tab. 0 Quote Link to comment Share on other sites More sharing options...
Fusionbird Posted March 18, 2010 Author Share Posted March 18, 2010 Have you allowed your server's IP access to the API? Setup > General Settings > Security tab. Yes, I did the same for allowing my IP Address for doing the API connections. Previously it was giving "Invalid IP Address" error, then after I added the IP for solving it. 0 Quote Link to comment Share on other sites More sharing options...
Fusionbird Posted March 22, 2010 Author Share Posted March 22, 2010 Have you allowed your server's IP access to the API? Setup > General Settings > Security tab. Any comments regarding the issue would be great. 0 Quote Link to comment Share on other sites More sharing options...
Fusionbird Posted March 25, 2010 Author Share Posted March 25, 2010 John, Any help ? 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted March 25, 2010 Share Posted March 25, 2010 Are you sure the administrator credentials from WHMCS are right (with API permissions)? Did you give in the password in md5 format? If so, post your script, so we can take a look. 0 Quote Link to comment Share on other sites More sharing options...
tdog89 Posted April 18, 2010 Share Posted April 18, 2010 Hello, I am having the same issue. I made sure i have the iP address in the security tab. I took it out and tried than and got invalid ip address. Here is my script which is very basic i just wanted to see if you guys could possible help. <?php $url = "https://WHMC API Installation"; # URL to WHMCS API file $username = "API-username"; # Admin username goes here $password = "API-password"; # Admin password goes here $postfields["action"] = "addclient"; $postfields["firstname"] = "Test"; $postfields["lastname"] = "User"; $postfields["companyname"] = "WHMCS"; $postfields["email"] = "demo@whmcs.com"; $postfields["address1"] = "123 Demo Street"; $postfields["city"] = "Demo"; $postfields["state"] = "Florida"; $postfields["postcode"] = "AB123"; $postfields["country"] = "US"; $postfields["phonenumber"] = "123456789"; $postfields["password2"] = "demo"; $postfields["currency"] = "1"; $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"]; } ?> 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted April 18, 2010 Share Posted April 18, 2010 Hello, I am having the same issue. I made sure i have the iP address in the security tab. I took it out and tried than and got invalid ip address. Here is my script which is very basic i just wanted to see if you guys could possible help. <?php $url = "https://WHMC API Installation"; # URL to WHMCS API file $username = "API-username"; # Admin username goes here $password = "API-password"; # Admin password goes here $postfields["action"] = "addclient"; $postfields["firstname"] = "Test"; $postfields["lastname"] = "User"; $postfields["companyname"] = "WHMCS"; $postfields["email"] = "demo@whmcs.com"; $postfields["address1"] = "123 Demo Street"; $postfields["city"] = "Demo"; $postfields["state"] = "Florida"; $postfields["postcode"] = "AB123"; $postfields["country"] = "US"; $postfields["phonenumber"] = "123456789"; $postfields["password2"] = "demo"; $postfields["currency"] = "1"; $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"]; } ?> Change: $username = "API-username"; # Admin username goes here $password = "API-password"; # Admin password goes here To: $postfields["username"] = "API-username"; # Admin username goes here $postfields["password"] = md5("API-password"); # Admin password goes here 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.