Cpanel/WHM API Getting Started Help PHP

MikeMartinOSM

Registered
Apr 8, 2016
4
0
1
Canada
cPanel Access Level
Root Administrator
Hello! I'm looking to integrate some cpanel features in our in house CMS, specifically managing email forwarders and http redirects. Ideal usage to be within our own CMS (real time api)...idea is so our clients don't have to fuss with going into cpanel and recalling their login info just to do a email forwarder or something.

I've been digging around in the documentation and I'm beyond confused on how to get started. It would appear I need the UAPI based on the functionality but I'm not sure how to use it and go about getting authenticated...and actually I'm starting to doubt if I even know what the UAPI is intended for? Maybe I need a different API?

Could someone please give me some real world PHP examples on how to do this? I think I would need the "User and Password" option on that "Guide to API Authentication" but there appears to be no examples on how to authenticate that way AND use an API call? On each "Guide to ... API" it just specifically mentions only providing a security token but doesn't say how to generate one? Also with the "user and password" method, the example only shows for root access...what about calling some api functionality as a cpanel user?

For example, if I had valid cpanel user and password, how would I go about say simply running the list email pop accounts function?

Hopefully someone can help, as I've been spinning my wheels on this for hours!

Many thanks!