rocconeri Posted August 31, 2017 Share Posted August 31, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 1, 2017 WHMCS Developer Share Posted September 1, 2017 Hey, The API authentication details have to be admin details. There is no client api available in WHMCS at the current time. 0 Quote Link to comment Share on other sites More sharing options...
rocconeri Posted September 1, 2017 Author Share Posted September 1, 2017 (edited) 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 September 1, 2017 by rocconeri 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 1, 2017 WHMCS Developer Share Posted September 1, 2017 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? 0 Quote Link to comment Share on other sites More sharing options...
rocconeri Posted September 1, 2017 Author Share Posted September 1, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 1, 2017 WHMCS Developer Share Posted September 1, 2017 Without using your client, create a new PHP file on your server updating the path and credentials and visit this new php file in a browser. If you continue to receive an error, I would suggest opening a ticket with support for further in-depth assistance. 0 Quote Link to comment Share on other sites More sharing options...
rocconeri Posted September 1, 2017 Author Share Posted September 1, 2017 oh wow!!! so much easier than I thought! Thank you very much for your help and patience 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.