Author Topic: WHMCS new module - 404  (Read 2086 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
WHMCS new module - 404
« on: March 05, 2018, 04:25:23 PM »
Hey CWP forum,

I just installed WHMCS including the cwp module. Followed the video tutorial.
https://www.youtube.com/watch?v=96dizYdi6WY&

Account creation is not working and I get 404 not found when I try the api manual.

Anybody who can give me a hint or a solution?
Thank you very much!

Offline
*
Re: WHMCS new module - 404
« Reply #1 on: March 05, 2018, 05:22:17 PM »
what error throws you

Offline
*
Re: WHMCS new module - 404
« Reply #2 on: March 05, 2018, 05:29:16 PM »
Hey josemnunez

Thank you for your response.
I got the following error in WHMCS: Function not found

In the module log from WHMCS: the api response is empty.

But I think the problems seems to be the CWP api. You know a way to test it?
When I try to do a manual post to the CWP api I receive a 404 error.

Hope to hear from you soon.
Lexz

Offline
*
Re: WHMCS new module - 404
« Reply #3 on: March 05, 2018, 05:33:51 PM »
Be sure to create an api key and autotize the ip involved

can do a php and test the api, replacing the values of the variables
Code: [Select]
$ data = array ("key" => "MYKEY", "action" => 'list');
$ url = "https: // IPSERVERAPI: 2304 / v1 / account";
$ ch = curl_init ();
curl_setopt ($ ch, CURLOPT_URL, $ url);
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ ch, CURLOPT_POSTFIELDS, http_build_query ($ data));
curl_setopt ($ ch, CURLOPT_POST, 1);
$ response = curl_exec ($ ch);
curl_close ($ ch);

Offline
*
Re: WHMCS new module - 404
« Reply #4 on: March 05, 2018, 05:44:19 PM »
I created a api key with the right permissions.

Also tried the php example you sended (found it under the API module in CWP)
But the result is empty.

Tried it on two different cwp servers. One of them is a CWP pro.
Other ideas?

Offline
*
Re: WHMCS new module - 404
« Reply #5 on: March 05, 2018, 06:01:57 PM »
What does this script say?
Code: [Select]

sh /script/check_api


Offline
*
Re: WHMCS new module - 404
« Reply #6 on: March 05, 2018, 07:58:45 PM »
This is the output:

User API port 2302 check: OK
Oauth query check: OK
External API port 2304 check: OK
External API files and htaccess : OK
CSF Firewall status check: ENABLED
TCP_IN for port 2304 set in /etc/csf/csf.conf: OK
TCP_OUT for port 2304 set in /etc/csf/csf.conf: OK



Offline
*
Re: WHMCS new module - 404
« Reply #7 on: March 06, 2018, 10:05:01 AM »
Today I tested the example php code from another server and it worked.
The server I used for testing this time, is a simple LAMP server (no CWP)

So I think the problem is not the API from CWP but something in the webserver configuration.
Both servers I've tested yesterday run CWP.

I will let you know if I found the problem.


Offline
*
Re: WHMCS new module - 404
« Reply #8 on: March 07, 2018, 10:36:27 AM »
Found the problem!

The problem was in a firewall. The servers could not reach each other's API.

Thanks for the support!

Offline
*
Re: WHMCS new module - 404
« Reply #9 on: March 27, 2018, 08:24:39 AM »
So what did you do to the firewall

Offline
*
Re: WHMCS new module - 404
« Reply #10 on: March 27, 2018, 10:08:29 AM »
Nothing special. I had to open the ports on both sides.
Aswell on the requesting side as the server side. My requestging server wasn't allowed to use the API port for OUT traffic.

I thought it was port: 2304 (but it's good to check it, I'm not sure anymore)

Hope this will help you  :)