Jump to content

WHMCS API authentication


rocconeri

Recommended Posts

Hi all,

I'm new to API so hope you can be patience with me if I ask maybe an easy/newbie question.

 

I'm trying to connect to the API following the documentation, trying to do that with a client. I also did the procedure to create my API credentials with WHMCS.

I set a Basic authentication from the client, including my identifier and secret (is it necessary?) and I just copied the authentication code (taked from the Authentication page of WHMCS documentation) in my request, but I receive all the times Authentication Failed.

It seems that I can access only using the browser adding to the endpoint link the username and password parameters, and I receive Invalid API Command (maybe because I didn't gave any requests).

 

I know that it is a basic issue but I didn't find any help googling around internet, so I hope you can just point me to the right direction to overcome the authentication step.

 

Thank you.

Link to comment
Share on other sites

Hey,

 

The API authentication details have to be admin details. There is no client api available in WHMCS at the current time.

 

I mean that I'm trying to connect to the API with a client like Postman or others to test the request/response, using the admin credentials provided from the WHMCS Panel in Setup > Staff Management > Manage API credentials..

Edited by rocconeri
Link to comment
Share on other sites

  • WHMCS Developer

You need both the API identifier and secret.

 

This data needs to be POSTed to the includes/api.php file.

 

Is your API client definitely posting?

 

What is the exact message being returned through the API request?

 

If you try a standard php file to connect, using the code from http://developers.whmcs.com/api/sample-code/, does this work for you?

Link to comment
Share on other sites

Is your API client definitely posting?

 

Thanks for your answer.

 

Yes, my API client do POST, I can select every kind of transmission (GET, POST, PUT, ecc...)

 

What is the exact message being returned through the API request?

 

The exact message I receive is this "result=error;message=Authentication Failed"

 

If you try a standard php file to connect, using the code from http://developers.whmcs.com/api/sample-code/, does this work for you?

 

How should I connect this file? I've just tried to copy the text of the example (modyfing the URL and the credentials) in the body section of my client, but I just receive the same Authentication Failed message.

 

Thank you.

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