SOLVED DomainInfo stopped working

jimlongo

Well-Known Member
Mar 20, 2008
253
21
68
I've been running into some problems since a recent update to WHM. On today's agenda is a call i've been making for years from WHMCS using a curl call to WHM UAPI.

GET to
Authentication is in the header with an access token.

Now I'm getting a 301 response in WHMCS.

When I test the call in Postman I get a 200 with the following error
Code:
{"cpanelresult":{"module":"DomainInfo","error":"Could not find function 'list_domains' in module 'DomainInfo'","apiversion":2,"data":{"result":0,"reason":"Could not find function 'list_domains' in module 'DomainInfo'"},"func":"list_domains"}}
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,027
313
cPanel Access Level
Root Administrator
Hey there! I'm not aware of anything that has changed recently on the cPanel side related to this call. I do see you are using port 2087 instead of port 2083, so you may want to consider adjusting that.

We have an example of a Curl request with a token that was provided by one of our developers here:


so it might be worth comparing that to how your curl command is configured to see if that matches.
 

jimlongo

Well-Known Member
Mar 20, 2008
253
21
68
Thanks for the reply, that did end up helping by giving me some things to look at.

The port I have is correct, it needs to be 2087 for this type of call.

My problem (just in case it helps someone else) is in WHMCS I was getting the information to make the call ($protocol, $hostname,$username,$secure) from the table `tblservers` which is the list of connected provisioning servers.

I was using the $secure variable to decide whether to use the http or https protocol in the url I'm calling.

It looks like this setting in the db should have the values of "on" or "off", but somehow in my DB had changed to a value of 1.
So my call was using http . . .
 
Last edited: