API Permissions for child websites?

Clarkeez

Registered
Feb 17, 2012
2
0
51
cPanel Access Level
Reseller Owner
Hey

I have a reseller package / hosting from UK Web Solutions Direct and I'm having a problem with using the API.

I have a PHP script that automatically creates a email account on cpanel via the API.
This works fine if you enter the cpanel user and pass of the domain you want to add the email account too.

What I want to do is enter the cpanel user and pass of my reseller main account and then add email accounts on different domains without changing the cpanel user and pass.

The thing that confuses me is that using the user and pass of my reseller main account within cpanel allows me full access to different domains control panels, so why is this different for the API?

This is the script (if taken the user/pass/domain out for obv reasons):
/http://pastebin.com/HAdxYUBL
Any help or pointers would be great.

Regards,
Matt Clarke
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Reseller override works in the APIs as well.

For example, in line 53, you are authenticating into the API using your reseller credentials.

However, when we get to line 60 where we need to know which cPanel account you want to add that email account to, you are specifying to add it to your reseller account's cPanel account. You need to actually specify which cPanel account that email account will be created in on line 60 just like when you do the reseller override thing, you need to select which cPanel account you want to control.

You're on the right track, just when it comes to the API, it just needs to have more things explicitly stated.