KGV Consulting Posted February 10, 2019 Share Posted February 10, 2019 Hey, I'm trying to test WHMCS API Authentication using "Postman" and continue to get Authentication error - 403 Forbiden the WHMCS activity log does not record anything, Im using json, all setting described in the development documentation are executed, here is sample of the code: POST /whmcs/includes/api.php? HTTP/1.1 Host: mydomain.com Content-Type: application/json cache-control: no-cache Postman-Token: ############################ { "action": "DomainWhois", "username": "Identifier", "password": "Secret", "accesskey": "accesskey", "domain": “testdoamin.com", "responsetype": "json" }------WebKitFormBoundary7MA4YWxkTrZu0gW-- Im continuing to get that error. Any advice how that can be corrected or fixed? I don't use PHP, prefer JavaScript, Python instead Thanks 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 10, 2019 Share Posted February 10, 2019 Under WHMCS admin -> Setup menu -> General Settings -> Security tab, do you have the IPs you're connecting from listed in "API IP Access Restriction" ? If not, add them and see if that helps. 0 Quote Link to comment Share on other sites More sharing options...
KGV Consulting Posted February 11, 2019 Author Share Posted February 11, 2019 Hi steven99, I did that, the IP is listed, also I set up access key as described in the documentation: https://developers.whmcs.com/api/access-control/ by doing that I could avoid whitelisting of every IP that would access the server, regardless of those steps Im continuing to get this error. Also I'm using WHMCS v7.7 and PHP 7.2.14 1 Quote Link to comment Share on other sites More sharing options...
bjamal Posted May 17, 2021 Share Posted May 17, 2021 I have the same Issue. From Potsman and from Micorosft Flow: "Authentication Failed" 0 Quote Link to comment Share on other sites More sharing options...
Trescpress Posted December 3, 2021 Share Posted December 3, 2021 I have a similar issue. I am trying to call an API endpoint in WHMCS from a laravel app. public function exec(String $action = null, Array $data = [], String $responseType = 'json') { $url = config('app.WHMCS_URL').$this->suffix; $data['username'] = $this->identifier; $data['password'] = $this->secret; $data['responseType'] = $responseType; $data['action'] = $action; // dd($data); $response = HTTP::withBasicAuth(config('app.BASIC_AUTH_USR'), config('app.BASIC_AUTH_PWD'))->withHeaders([ 'Content-Type' => 'multipart/form-data', 'Accept' => '*/*' ])->post($url, $data); dd($response->body()); // "result=error;message=Authentication Failed" return ; } The same exact keys work in postman. I'm stuck, am missing anything? 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted December 3, 2021 Share Posted December 3, 2021 7 hours ago, Trescpress said: The same exact keys work in postman. I'm stuck, am missing anything? If you're using API keys and not users, change username to identifier and password to secret per https://developers.whmcs.com/api/authentication/ 0 Quote Link to comment Share on other sites More sharing options...
ramf Posted December 26, 2021 Share Posted December 26, 2021 Hi, I noticed that there are several posts here regarding sending API commands using postman - But I couldn't find an answer here also in this post or any other. I know that in order to send API command to WHMCS I should authenticate using identifier, secret and an accesskey - But when I'm trying to use them in posman I'm getting `result=error;message=Authentication Failed` error. I have no problem sending API commands via integromat using the same information. this is an example for the raw body I'm sending as a GET request to my /includes/api.php address: { "action": "GetTicket", "identifier": "XXXXXXX", "secret": "YYYYYY", "accesskey": "ZZZZZZZ", "responsetype": "json", "ticketid": "1234" } In my WHMCS I've setup the API_Authentication_Credentials (So I have the relevant identifier and secret) and also added the relevant accesskey to my configuration.php - But still the same error. Maybe I should configure some authorization in postman? Can someone please help? Thanks! Ram 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.