externally accessible api
What current API types are available to access WHM from an external app?
Primarily to get all domains (and subdomains) from an account. Might need to get userID from a main domain as well.
In this case WHMCS.
-
Hello @jimlongo, Here are some WHM API 1 functions that you may find useful for this purpose: WHM API 1 Functions - get_domain_info - Developer Documentation - cPanel Documentation Guide to API Authentication - Developer Documentation - cPanel Documentation Let us know if you have any questions. Thanks! 0 -
Thanks, every time I read about API1 it says deprecated, so I'm trying to stay with API2 so that the code won't break at some point. Also unless I'm not seeing it I don't see anyway to get the subdomains and addonDomains for an account. For instance I can authenticate using an APIToken (which is what I have available). Using the example ; 0 -
I'll leave this for someone else if they run across this. With a Token for auth. will return all the subdomains for that user. It would be a lot neater if one could use the UAPI DomainInfo:: 0 -
Thanks, every time I read about API1 it says deprecated, so I'm trying to stay with API2 so that the code won't break at some point.
Hello @jimlongo, WHM API 1 is not deprecated. The deprecated APIs are WHM API 0, cPanel API 1, and cPanel API 2.It would be a lot neater if one could use the UAPI DomainInfo:: Use WHM API to Call cPanel API and UAPI - Developer Documentation - cPanel Documentation For instance, to use UAPI per the above document, the URL would include the following:
cpanel_jsonapi_apiversion=3
Thank you.0 -
Thanks for that cPanelMichael. Helpful as usual! Using the APItoken for auth. [quote]$header[0] = "Authorization: whm $user:$token";
here you can get the account(user) based on domain [using WHM API 1]. . . [quote]https://mywhm.com:2087/json-api/cpanel?cpanel_jsonapi_user={user}&cpanel_jsonapi_module=DomainInfo&cpanel_jsonapi_func=list_domains&cpanel_jsonapi_apiversion=30
Please sign in to leave a comment.
Comments
5 comments