Use WHM API's from external server?

ritzzsoni

Registered
Nov 20, 2016
1
0
1
India
cPanel Access Level
Website Owner
I have my server "A" running on ruby on rails.

My hosting server "B" has WHM installed on it.

How can I use WHM's APIs to get some data about hosting server.

For example I want to list all the domains and sub domains per user.

Is it possible? if yes then how?

Any suggestion.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hello,

Yes, you can setup a custom script on the source server that connects to the cPanel server and utilizes WHM API 1 or UAPI functions. For example, this is a good WHM UAPI function to list domain names and subdomain names associated with an account:

UAPI Functions - DomainInfo::list_domains - Software Development Kit - cPanel Documentation

You may also find these documents helpful:

Guide to UAPI - Software Development Kit - cPanel Documentation
Guide to WHM API 1 - Software Development Kit - cPanel Documentation
Guide to API Authentication - Software Development Kit - cPanel Documentation

Thank you.