The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need a little bit of advice and help integrating the cPanel API(s)

Discussion in 'cPanel Developers' started by ItsssJustice, Sep 6, 2014.

  1. ItsssJustice

    ItsssJustice Registered

    Joined:
    Sep 6, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Bishops Stortford, United Kingdom
    cPanel Access Level:
    Website Owner
    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 Email Module Documentation)

    Could you point me in the right direction if I am using the wrong api or am implementing it incorrectly?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,745
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page