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.

Simple question on xml-api

Discussion in 'cPanel Developers' started by cix, Apr 15, 2010.

  1. cix

    cix Well-Known Member

    Joined:
    Nov 6, 2003
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Hello, I'm new to this.

    I need to enable my users to change their email passwords using a simple PHP.

    So XML-api can help me on this?

    If yes, how can I install it? Or it came with cpanel?

    I'm using vps cpanel.

    Thanks
     
  2. leefrom

    leefrom Active Member

    Joined:
    May 27, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
  3. cix

    cix Well-Known Member

    Joined:
    Nov 6, 2003
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    XML-API came with cpanel?

    Sorry, I did read that post, but still a bit obscure for me.
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi cix,

    The XML-API is a part of WHM/cPanel. It listens for URL requests and will perform actions or give information. These URL requests can be made from any machine, including your cPanel box.

    The XML-API has a few functions but it also includes the functionality to perform cPanel's API1 and API2 calls. API1 and API2 calls are what cPanel's Themes and general interface use to fetch information and perform cPanel-user actions.

    What Lee has suggested is that you perform an API2 Password::change_password module/function call via Matt's PHP XML-API client class.

    All that Matt's class does is provide a convenient object-oriented PHP class that can perform XML-API, API1 or API2 calls. If you aren't familiar with making remote, automated URL queries in PHP, then Matt's class would be very handy since it does all this.

    Probably a better resource for the XML-API, what it is, and how it's used is our over at our Developer Docs:
    XML and JSON APIs

    As well, there should be numerous examples here in the forums about how to use Matt's class for make queries to the XML-API engine.

    If you're hosting your PHP application within cPanel you can also use LivePHP or cPanel PHP. LivePHP lets you send API1/2 calls to the local machine, and cuts our the remote call. CPanel PHP is php files that get parse by cPanel before they're parsed by the PHP engine. In this way, you can put API1/2 tags right into you PHP file (just like HTML) and it will works just like any other cPanel Theme or interface (except it's in PHP, not Perl). LivePHP and cPanel PHP are documented also at our documentation center.

    Let us know if you need more help.

    -Dave
     
Loading...

Share This Page