json api call with cpanel for ssl details

amvis

Registered
Jun 11, 2014
2
0
1
cPanel Access Level
Website Owner
i have installed the ssl certificate in client account and have been trying to call the json api from rails to get the response from SSL::listcrts, but i am getting the response is

"{\"cpanelresult\":{\"func\":\"listcrts\",\"apiversion\":2,\"module\":\"SSL\",\"data\":[],\"event\":{\"result\":1}}}\n",

but i can see that ssl certificate details in user's cpanel. why here the host is null?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello :)

Could you provide more details on how you are utilizing the SSL::listcrts API2 function? How does it look in your application?

Thank you.
 

amvis

Registered
Jun 11, 2014
2
0
1
cPanel Access Level
Website Owner
These are the three calls, which calling the SSL::listkeys,SSL::listcsrs,SSL::listcrts

IP:2086/json-api/cpanel?user=sslacnt&cpanel_jsonapi_module=SSL&cpanel_jsonapi_func=listkeys&cpanel_jsonapi_version=2
IP:2086/json-api/cpanel?user=sslacnt&cpanel_jsonapi_module=SSL&cpanel_jsonapi_func=listcsrs&cpanel_jsonapi_version=2
IP:2086/json-api/cpanel?user=sslacnt&cpanel_jsonapi_module=SSL&cpanel_jsonapi_func=listcrts&cpanel_jsonapi_version=2

Here in the three cases, i have got the details from keys and csrs but not from crts?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello :)

If you are using WHM, you could try using WHM API 1. EX:

Code:
hxxp://example.com:2086/cpsess123456789/json-api/fetchsslinfo?api.version=1&domain=test-domain.com
Or, with cPanel, you could try using UAPI. EX:

Code:
hxxp://example.com:2086/cpsess123456789/execute/SSL/list_certs
A full list of SSL options with UAPI are available at:

UAPI - SSL

Thank you.