evcz Posted May 14, 2009 Share Posted May 14, 2009 (edited) I'm trying this code: $url = "http://www.mydomain.tld/includes/api.php"; # URL to WHMCS API file $username = "myadminusername"; # Admin username goes here $password = "myadminpassword"; # Admin password goes here $postfields["username"] = $username; $postfields["password"] = md5($password); $postfields["action"] = "encryptpassword"; $postfields["password2"] = "aPASSwordIwantTOencrypt"; $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! echo $results['password']; } else { # An error occured echo "The following error occured: ".$results["message"]; } on many different boxes (even tried on the same box as the one running whmcs) but getting everywhere: result=error;message=Invalid IP ***.***.***.*** what am I doing wrong? I just want to integrate my own website letting the users to login with their whmcs data but I do not know which salt you are using so I've to deal with this thing called API (I really wish there was another way to get a password "encrypted"...) I thought I would just do everything on my own and check if the login was valid with a simple mysql query... but found me in stuck with this damn api thing Edited May 14, 2009 by evcz 0 Quote Link to comment Share on other sites More sharing options...
cyberneticos Posted May 14, 2009 Share Posted May 14, 2009 yup result=error;message=Invalid IP 85.x.x.x 0 Quote Link to comment Share on other sites More sharing options...
cyberneticos Posted May 14, 2009 Share Posted May 14, 2009 Here she is : When adding an API admin user, the user only needs access to the API. You must also setup the IP(s) you will be connecting from in General Settings > Other. Failure to do this will result in an error Invalid IP hehehee 0 Quote Link to comment Share on other sites More sharing options...
evcz Posted May 14, 2009 Author Share Posted May 14, 2009 yeah got that reply too ^^ good 0 Quote Link to comment Share on other sites More sharing options...
battisti Posted October 22, 2009 Share Posted October 22, 2009 yeah got that reply too ^^ good I'm using whcms 4.1 version and i don't found this configuration, whem i put the ip number? 0 Quote Link to comment Share on other sites More sharing options...
battisti Posted October 22, 2009 Share Posted October 22, 2009 I'm using whcms 4.1 version and i don't found this configuration, whem i put the ip number? Finaly i found, the problem is in documentation, in the link http://wiki.whmcs.com/API:About is write When adding an API admin user, the user only needs access to the API. You must also setup the IP(s) you will be connecting from in General Settings > Other. Failure to do this will result in an error Invalid IP BUT TO CONFIGURE THE IP IS IN THE TAB SECURITY 1 Quote Link to comment Share on other sites More sharing options...
dm800pvr Posted April 14, 2011 Share Posted April 14, 2011 there is no such thing in general/other in whmcs 4.4.x 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted April 14, 2011 WHMCS Support Manager Share Posted April 14, 2011 This is a very old thread, it's been moved to Setup > General Settings > Security tab. 0 Quote Link to comment Share on other sites More sharing options...
AndyIsHereBoi Posted February 27, 2023 Share Posted February 27, 2023 Is this correct for allowing a range of IPS? or is that not supported -1 Quote Link to comment Share on other sites More sharing options...
sinebi Posted March 27, 2023 Share Posted March 27, 2023 I have my IP address to the white list yet I still get this error result=error;message=Invalid IP 41.***.*** I am using postman to make my API Call , What I am i not doing correctly? 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.