Community Forums
Connect with us on LinkedIn
  
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jul 2009
    Posts
    11

    Default Hello API

    I have been really struggling with APIs. I have so far been unable to get anything and I still don't have a clue about how to call them. I have found the cPanel documentation little help.

    I think that what I need is the API equivalent of "Hello world" - a very simple url, php procedural script etc to output something, anything.

    Can some kind soul provide such a basic bit of code please?

  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 isandell View Post
    I have been really struggling with APIs. I have so far been unable to get anything and I still don't have a clue about how to call them. I have found the cPanel documentation little help.

    I think that what I need is the API equivalent of "Hello world" - a very simple url, php procedural script etc to output something, anything.

    Can some kind soul provide such a basic bit of code please?
    If your preferred programming language is PHP 5, you may want to use Matt's PHP 5 class for our APIs as it includes many of these small "hello world" type of code samples. You can find this code archive at:

    http://forums.cpanel.net/f42/xmlapi-...ss-111897.html

    If you prefer to use another programming language, let me know and I'll see what I can get put together for you.

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

    Root Administrator

    Default

    ** Moved thread to Developer Corner **

  4. #4
    Member
    Join Date
    Jul 2009
    Posts
    11

    Default

    I think that we are talking at cross-purposes. The APIXML class is 400 lines of code. I can get nothing to work with this, zilch, zero, nought - just loads of error messages.

    That's why I asked for just a few line of code, dont mind if it's PHP, Perl or Sinclair basic. Just something that I can run for produce some output other than error statements.

    Ok, I give up now. Thanks for your help but I now realise that I am destined not to understand and be able to use cP APIs.

    I have some code the works for now. It may stop working in the future (I suspect some years in the future) so may revisit if and when that happens.

    Thanks for your time

    A disappointed Ian

  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 isandell View Post
    I think that we are talking at cross-purposes. The APIXML class is 400 lines of code. I can get nothing to work with this, zilch, zero, nought - just loads of error messages.

    That's why I asked for just a few line of code, dont mind if it's PHP, Perl or Sinclair basic. Just something that I can run for produce some output other than error statements.

    Ok, I give up now. Thanks for your help but I now realise that I am destined not to understand and be able to use cP APIs.

    I have some code the works for now. It may stop working in the future (I suspect some years in the future) so may revisit if and when that happens.

    Thanks for your time

    A disappointed Ian
    Can you select one code sample that you were unable to get working and share the errors you encountered so I can have the opportunity to assist you?

  6. #6
    Member
    Join Date
    Jul 2009
    Posts
    11

    Default

    Quote Originally Posted by cPanelDavidG View Post
    Can you select one code sample that you were unable to get working and share the errors you encountered so I can have the opportunity to assist you?
    This is typical. I have replacement my real username in the attached file with "username".
    Attached Files

  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 isandell View Post
    This is typical. I have replacement my real username in the attached file with "username".
    In the scenario noted in the text file you attached, what happened is you did not successfully authenticate into cPanel or WHM (whichever you were attempting to log into). As a result the XML parser was trying to process HTML and that led to a long list of errors.

  8. #8
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    What version of cPanel are you running? That class can have issues with some of the new security functions that exist in EDGE. I should be releasing an updated version in not too much longer.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  9. #9
    Member
    Join Date
    Jul 2009
    Posts
    11

    Default

    Quote Originally Posted by cPanelMatt View Post
    What version of cPanel are you running? That class can have issues with some of the new security functions that exist in EDGE. I should be releasing an updated version in not too much longer.
    Version 11.24.4-STABLE

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 06-04-2011, 09:52 AM
  2. Api
    By Hitakashi in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-15-2010, 01:11 PM
  3. Hello API
    By isandell in forum New User Questions
    Replies: 1
    Last Post: 07-14-2009, 10:40 AM
  4. Api
    By cpnaba in forum cPanel Developers
    Replies: 0
    Last Post: 05-12-2007, 01:05 AM
  5. Api
    By Valuex.Ru in forum cPanel Developers
    Replies: 3
    Last Post: 03-06-2007, 06:03 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube