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.

Whm Api

Discussion in 'General Discussion' started by Parahosting, Mar 13, 2008.

  1. Parahosting

    Parahosting Well-Known Member

    Joined:
    Apr 6, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Is it possible to have an API that is not PHP or Perl for cPanel to be able to create/manage accounts? I am currently using Rails and I have not found any API relating to the framework or the Ruby language itself.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Yes, simply use the XML-API instead of the older WHM API. You can find documentation for the XML-API on our website at: http://www.cpanel.net/plugins/xmlapi
     
  3. Parahosting

    Parahosting Well-Known Member

    Joined:
    Apr 6, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Wow, thanks David. I thought I was lost for a second. :)
     
  4. Parahosting

    Parahosting Well-Known Member

    Joined:
    Apr 6, 2007
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Hold on, how exactly would I use this API? I am clueless. =/;
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You're essentially calling a specially URL that returns some XML data. You would need to parse the XML output to retrieve the data you need.

    If you are familiar with PHP, there are many code samples floating about this forum involving the XML-API. Perhaps you could port those to an appropriate RoR equivalent.

    This isn't a library you install, all you need is the tools to establish and connect to HTTP (though preferably HTTPS) servers and the ability to process XML.
     
  6. vivekvsist

    vivekvsist Active Member

    Joined:
    May 29, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Can you tell me how can I parse the raw xml output to my own php code ?
    I wrote a php code for listing accounts under a user. but not sure how to list the raw xml output to my php file
     
  7. vivekvsist

    vivekvsist Active Member

    Joined:
    May 29, 2007
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    I already checked this. Found no useful examples to start.
    I am not a professional php coder. So I need examples to understand.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Personally, I like using PHP5 with SimpleXML to process raw XML into data that's usable in my PHP scripts. The documentation for SimpleXML can take a while to understand though: http://php.net/simplexml
     
Loading...

Share This Page