WHM API to retrieve cPanel Theme list

celerius

Registered
Oct 3, 2014
2
0
1
cPanel Access Level
Root Administrator
Hi,

Is there an API that'll allow me to retrieve a list of cPanel themes that a user can select in the system? I can do WHM API 0's modifyacct to modify the theme of the user but where can I get a list of the themes? If there isn't an API that will give me a list, are there any other APIs that has that data inside where I can parse and extract that information to form a list?

I see that cPanel's API 2 has Branding::showpkgs but I'm unable to call the API with user=root and even when I switch the user to a non-root account I get a JSON response like this showing no themes.

Code:
https://example.com:2087/<token>/json-api/cpanel?user=john&cpanel_jsonapi_module=Branding&cpanel_jsonapi_func=showpkgs&cpanel_jsonapi_version=2

{"cpanelresult":{"func":"showpkgs","data":[],"event":{"result":1},"apiversion":2,"module":"Branding"}}
Thanks
 

celerius

Registered
Oct 3, 2014
2
0
1
cPanel Access Level
Root Administrator
i found that WHM API version 0's getlanglist actually has a list of themes in it but it's not showing the same list as the ones I see when I login to WHM/cPanel to create a new user. Is there an equivalent for API version 1 that actually works?
 

AndrewH.

Well-Known Member
Dec 10, 2012
52
3
83
cPanel Access Level
Root Administrator
After a quick glance in WHM we are using functionality which is exposed via cPanel API2(Themes::get_available_themes). Unfortunately I can't seem to find any documentation but this call does not appear to have any parameters you pass to it, instead just call it and it should return the themes available to the user who you are authenticated with.