Need a little bit of advice and help integrating the cPanel API(s)
I've been looking for a few days on your forums and can't seem to find relevant information regarding what I'm attempting to do.
Essentially what I'm trying to do is: Allow a user to change their account password on my website. If they have an email account on my hosting (already dealt with), then I'd like to change their email password (problem) at the same time. I'd like this to be done completely as a background process if possible (showing none of the cPanel to the user who is changing the password).
I think I have to use the XML-api but I'm not completely sure. I've tried implementing this by downloading and including the xmlapi.php from https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php however when looking at this example https://github.com/CpanelInc/xmlapi-php/blob/master/Examples/createacct_example.php it seems like I have to have root access to the server to use the api? (Which I don't - I'm on shared hosting and only have access to edit settings based on my own website)
I've found the function I believe I need to use which is "Email::passwdpop" from api 1, however if I'm correct, you call api 1 from the xml api? (from looking at [url=http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api1/ApiEmail#Email::passwdpop]Email Module Documentation)
Could you point me in the right direction if I am using the wrong api or am implementing it incorrectly?
-
Hello, Root credentials are not required for API 1 or API 2, but I suggest using API 2. The following documents should help you get started: cPanel API2 Functions Passwd Email::passwdpop API2 PHP Example If possible, see if your provider can enable the "API Shell" feature on your account, as that is often a helpful utility. Thank you. 0
Please sign in to leave a comment.
Comments
1 comment