Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 24
  1. #1
    Member
    Join Date
    Oct 2001
    Posts
    348

    Default xml-api avaliable yet ?

    When reading http://www.cpanel.net/plugins/xmlapi...api__listaccts
    I got a few questions:
    1. Is this avaliable now ? Do I must have whm upgrade to version 11 to be able to use it ?

    2. What is that "Calling this URL in WebHost Manager" means ? Can you make a example if I using php, how should I actually "call" it ?

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by jameshsi View Post
    When reading http://www.cpanel.net/plugins/xmlapi...api__listaccts
    I got a few questions:
    1. Is this avaliable now ? Do I must have whm upgrade to version 11 to be able to use it ?
    It is available for those running cPanel/WHM 11 (EDGE and CURRENT builds as of right now).

    Quote Originally Posted by jameshsi View Post
    2. What is that "Calling this URL in WebHost Manager" means ? Can you make a example if I using php, how should I actually "call" it ?
    It's actually pretty simple. Are you familiar with reading data from a URL in PHP? It's the same thing. When the documentation states call a URL, you are merely fetching data from a URL - that data being in XML format.

    Example URL:
    https://domain.com:2087/xml-api/setu...ob&makeowner=1

    The parameters you pass depending on the API call, consult the API documentation for details. Essentially you are just opening that URL and the data returned will be the XML formatted information you are requesting (or status information for an action you have performed).

  3. #3
    Member
    Join Date
    Oct 2001
    Posts
    348

    Default

    As always, cpanel always saving words when it comes to documentation, seems people in cpanel don't like to type more words. If you put something like "this documentation is only for WHM 11", we can save time to even try the xml-api.

  4. #4
    Member
    Join Date
    Dec 2003
    Posts
    16

    Default

    Quote Originally Posted by jameshsi View Post
    As always, cpanel always saving words when it comes to documentation, seems people in cpanel don't like to type more words. If you put something like "this documentation is only for WHM 11", we can save time to even try the xml-api.
    In addition to this.... can the cPanel doc guys produce a full list of usage commands which are implimented inside the api, from creation of an account (which exists) to changing a password (which doesnt)..

    Cheers

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by maxstudios View Post
    In addition to this.... can the cPanel doc guys produce a full list of usage commands which are implimented inside the api, from creation of an account (which exists) to changing a password (which doesnt)..

    Cheers
    You mean like http://www.cpanel.net/plugins/xmlapi/index.html ?

  6. #6
    Member
    Join Date
    Dec 2003
    Posts
    16

    Default

    hi cPanelDavidG,

    There are a few functions on there that there isnt any documentation for... for example passwd.

    I know as cp11 is still under development but it would be handy to have.

    Also, does the xml api still use the original authentication method.??....

    Cheers

  7. #7
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by maxstudios View Post
    hi cPanelDavidG,

    There are a few functions on there that there isnt any documentation for... for example passwd.

    I know as cp11 is still under development but it would be handy to have.

    Also, does the xml api still use the original authentication method.??....

    Cheers
    I'll be sure to nag the folks that maintain our website once they're back in the office

    The XML API uses the same authentication method (HTTP Authentication) as the WHM interface. As a result, you do not need a remote access key with the XML API.

  8. #8
    Member
    Join Date
    Sep 2001
    Posts
    315

    Default

    Quote Originally Posted by cPanelDavidG View Post

    The XML API uses the same authentication method (HTTP Authentication) as the WHM interface. As a result, you do not need a remote access key with the XML API.
    Does this mean I can use this API only inside WHM? I can not use the api to create an account outside whm, for example integrated in my customer management scripts?

    Michael

  9. #9
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by CoolMike View Post
    Does this mean I can use this API only inside WHM? I can not use the api to create an account outside whm, for example integrated in my customer management scripts?

    Michael
    It wouldn't be much of an API (intended for third party scripts) if you could only use it inside WHM

    You can call the entire URL directly (ex: https://sample.ext:2087/xml-api/list...e=user&search= ), and use whatever functions in the language you are using that handle HTTP Authentication to handle the HTTP Authentication properly
    Last edited by cPanelDavidG; 06-06-2007 at 03:56 PM. Reason: Clarification

  10. #10
    Member
    Join Date
    Sep 2001
    Posts
    315

    Default

    Thanks for the information, but why not using the remote access hash? I hate it, when I need to specify the root password in my php scripts.

  11. #11
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by CoolMike View Post
    Thanks for the information, but why not using the remote access hash? I hate it, when I need to specify the root password in my php scripts.
    I'd recommend creating a separate account with root-level privileges in WHM to avoid placing your root password in a PHP script.

  12. #12
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    Quote Originally Posted by CoolMike View Post
    Thanks for the information, but why not using the remote access hash? I hate it, when I need to specify the root password in my php scripts.
    The has will work as well.

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by cPanelDavidG View Post
    You can call the entire URL directly (ex: https://sample.ext:2087/xml-api/list...e=user&search= ), and use whatever functions in the language you are using that handle HTTP Authentication to handle the HTTP Authentication properly
    Why don't you be so kind to place PHP code showing the use of this method?
    You did this for "cPanel::Accounting Modules" but seems XML API much powerfull.
    Regards, Alexey

  14. #14
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by AlexAT View Post
    Why don't you be so kind to place PHP code showing the use of this method?
    You did this for "cPanel::Accounting Modules" but seems XML API much powerfull.
    Very quick and dirty PHP code for using the XML API from PHP:


    $apiPath = "/xml-api/listaccts?searchtype=user&search=";

    $result = file_get_contents("http://$user:$pass@localhost:2086$apiPath");

    echo $result;


    Be sure to set $user and $pass to your username and password.

    I'd recommend you use https:// and port 2087 if that option is available to you on your servers

  15. #15
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    So simple
    Will try, thank you!
    Regards, Alexey

Similar Threads & Tags
Similar threads

  1. XML API 2 help
    By Dragonxito in forum cPanel Developers
    Replies: 1
    Last Post: 05-13-2011, 04:23 PM
  2. xml-api/accountsummary
    By monaghan in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-25-2008, 03:57 PM
  3. XML-API is any of these possible?
    By neo4242002 in forum cPanel Developers
    Replies: 3
    Last Post: 03-17-2008, 01:46 PM
  4. XML API: always get login screen, not XML
    By sldff3ald in forum cPanel Developers
    Replies: 3
    Last Post: 09-19-2007, 09:29 AM
  5. How do I use the xml - api?
    By rhopperger in forum cPanel Developers
    Replies: 3
    Last Post: 05-19-2007, 08:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube