Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 513 Vote(s) - 3.54 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WHMCS error occured: Invalid IP ::1, when using External API

#1
I am trying out GetClient Password on External API

<?php
$url = "http://localhost:81/whmcs/includes/api.php"; # URL to WHMCS API file goes here
$username = "admin"; # Admin username goes here
$password = "pass"; # Admin password goes here

$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "GetClientPassword";
$postfields["userid"] = "1";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
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") {
echo "Success<br />
<br />
";
# Result was OK!
} else {
# An error occured
echo "The following error occured: ".$results["message"];
}
?>

Getting an error

> result=error;message=Invalid IP ***.***.***.***

I already added the IP in General Setting -> Security Tab.

Note: I am trying this on localhost (xampp)

What am I missing here?
Reply

#2
This error means the API Access Key has not been added successfully to the configuration.php file. Please refer to step 7 above. The $api_access_key line should go before the closing ?> tag.

[Source][1]


[1]:

[To see links please register here]


You can also whitelist your IP by following

Setup>General>Security>API IP Access Restriction

Reply

#3
if you have a account on whmcs, you will have to white-list the IP Address from where you want to access the api. it's a kind of security measure used by the whmcs team so as not to allow an unauthorized user use one's api. i hope this is helpful. Thanks
Reply

#4
Alternatively an access key can be configured to allow IP restrictions to be bypassed.

It works by defining a secret key/passphrase in the WHMCS configuration.php file which is then passed into all API calls. To configure it, add a line as follows to your configuration.php file in the root WHMCS directory.

$api_access_key = 'secret_key_passphrase_goes_here';

Following the introduction of an API Access Key, you can then include it in your API requests as follows:

?action=xxxx&username=xxx&password=xxx&accesskey=secret_key_passphrase_goes_here


More Infos:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through