Jump to content

result=error;message=Authentication Failed


KGV Consulting

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 years later...
  • 6 months later...

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?

Link to comment
Share on other sites

  • 4 weeks later...

 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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated