Page 5 of 8 FirstFirst ... 34567 ... LastLast
Results 61 to 75 of 109

Thread: XMLAPI php class

  1. #61
    Member
    Join Date
    Dec 2008
    Posts
    153

    Default

    got the error

    open failed: No such file or directory at cpanel.pl line 663
    (internal death while parsing ) Tue Jun 9 09:03:04 2009 [9906] error: open failed: No such file or directory at cpanel.pl line 663
    Carp::croak('open failed: No such file or directory') called at /usr/local/cpanel/Cpanel/Fileman.pm line 1139
    Cpanel::Fileman::fmsavefile('/public_html') called at cpanel.pl line 663
    main::__ANON__('/public_html') called at cpanel.pl line 1779
    main::exectag('<cpanel Fileman="fmsavefile(/public_html)">') called at cpanel.pl line 1545
    main::docpanelaction('<cpanelaction><module>Fileman</module><func>fmsavefile</func><ap...') called at cpanel.pl line 4763
    main::dotag(undef) called at cpanel.pl line 4638
    main::cpanel_parseblock('SCALAR(0x94ecafc)') called at cpanel.pl line 1228

  2. #62
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Looks like you have a typo in your api_query call. It's calling Filem an and not Fileman
    Matt Dees

  3. #63
    Member
    Join Date
    Aug 2004
    Posts
    31

    Default

    Hi Matt,

    How do you add contactemail to createacct?
    Last edited by kgp43; 06-20-2009 at 10:22 AM.

  4. #64
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,307
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by kgp43 View Post
    Hi Matt,

    How do you add contactemail to createacct?
    To set a contact email while creating an account in the XML API, just pass a createemail argument. You can find documentation for this at:

    CreateAccount < AllDocumentation/AutomationIntegration < TWiki

  5. #65
    Member
    Join Date
    Jun 2004
    Location
    Illinois, USA
    Posts
    8

    Default

    How would I delete an email forwarder?

    I tried the following:
    PHP Code:
    $results $xmlapi->api1_query($accounts"Email""delforward",
                    array(
                        
    email=>"testing@mydomain.com=fwrdemail@email.com",
                        
    emaildest=>"fwrdemail@email.com",
                        
    domain=>"mydomain.com"
                    
    )); 
    but no luck

  6. #66
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    It looks like you are attempting to pass an associative array to an API1 call. API1 takes regular arrays, API2 takes associative.

    The syntax used by the API1 call for delforward is:
    Code:
    $VAR1 = {
              'param0' => [
                            'matt@cptest.com=matt@somedomain.net'
                          ]
            };
    meaning that via the XML-API it should be called like:
    Code:
    <cpanelaction><apiversion>1</apiversion><module>Email</module><func>delforward</func><args>matt@cptest.com=matt@somedomain.net</args></cpanelaction>
    so via the XML-API class:

    Code:
    $results = $xmlapi->api1_query($accounts, "Email", "delforward",
                    array(
                        "matt@cptest.com=matt@somedomain.com"
                    ));
    Matt Dees

  7. #67
    Member
    Join Date
    Jul 2009
    Posts
    10

    Default cPanel API licensing

    Any chance we could get this released as GPL or some other open license? I'd love to create a Drupal module with this code included, so you could manage cPanel from Drupal. But no one in the Drupal community will touch it if it isn't GPL.

    Thanks,
    Chuck

  8. #68
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Chuck,
    I couldn't agree with you more, here's a version of this released under a modified BSD license, I'll be updating the link in the original post as well.

    http://sdk.cpanel.net/lib/cp_xmlapi_php.tar.gz
    Last edited by MattDees; 07-30-2009 at 02:10 PM.
    Matt Dees

  9. #69

    Default servicestatus

    this das not work, any one have any workaround to fix this?


    ServiceStatus < AllDocumentation/AutomationIntegration < TWiki


    https://domain.com:2087/xml-api/servicestatus


    show xml error header.


  10. #70
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Quote Originally Posted by nettcom View Post
    this das not work, any one have any workaround to fix this?


    ServiceStatus < AllDocumentation/AutomationIntegration < TWiki


    https://domain.com:2087/xml-api/servicestatus


    show xml error header.

    what version of cPanel are you running? This feature only exists in EDGE
    Matt Dees

  11. #71

    Default

    all others API functions is working, but the servicestatus not...




    I have my own classes to manage cpanel API, but for help and test pouposes I added this function to the API discusses in this forum for test:
    Code:
    file (xmlapi.php.inc)
    	public function servicestatus() {
    		return $this->xmlapi_query("servicestatus");
    	}
    
    
    test.php file:
    $ip = "127.0.0.1";
    $root_pass = "*************";
    
    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth("root",$root_pass);
    
    $xmlapi->set_debug(1);
    $k=$xmlapi->servicestatus();
    print_r($k);
    results:

    Code:
    QUERY: https://127.0.0.1:2087/xml-api/servicestatus? RAW XML: 
    Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Start tag expected, '<' not found in /backup/mmega/public_html/cp/xmlapi.php.inc on line 103
    
    Warning: simplexml_load_string() [function.simplexml-load-string]: in /backup/mmega/public_html/cp/xmlapi.php.inc on line 103
    
    Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /backup/mmega/public_html/cp/xmlapi.php.inc on line 103
    bool(false) SIMPLEXML OBJ: 
    Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Start tag expected, '<' not found in /backup/mmega/public_html/cp/xmlapi.php.inc on line 105
    
    Warning: simplexml_load_string() [function.simplexml-load-string]: in /backup/mmega/public_html/cp/xmlapi.php.inc on line 105
    
    Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /backup/mmega/public_html/cp/xmlapi.php.inc on line 105
    cPanel 11.24.5-R37629 - WHM 11.24.2 - X 3.9
    CENTOS 5.3 x86_64 standard


    regards
    Last edited by nettcom; 08-03-2009 at 03:38 AM.

  12. #72

    Default

    You're using [R]elease. The desired functionality is currently only available under [E]dge. Just wait untill it's carried out into the next build.

  13. #73
    Registered User
    Join Date
    Dec 2005
    Posts
    4

    Default

    Hi

    Notice: Undefined variable: self in xmlapi.php.inc on line 293

    Fatal error: Call to a member function query() on a non-object in xmlapi.php.inc on line 293

    Please replace $self on $this

  14. #74
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    Done.

    sdk.cpanel.net/lib/cp_xmlapi_php.tar.gz


    Thanks for the report, I guess that's what happens when you let a perl hacker write php code.
    Matt Dees

  15. #75
    Registered User
    Join Date
    Dec 2005
    Posts
    4

    Default

    293: return $self->query('listpkgs');

    should be replaced with an

    return $this->xmlapi_query('listpkgs');


    method "query" not exists for xmlapi class. Thanks.

Page 5 of 8 FirstFirst ... 34567 ... LastLast

Similar Threads

  1. XMLAPI Class on Git Hub
    By rmatakajr in forum cPanel Developers
    Replies: 1
    Last Post: 07-28-2011, 02:09 PM
  2. PHP xmlapi.php has been updated to version 1.0.11
    By cPanelDavidN in forum cPanel Developers
    Replies: 0
    Last Post: 06-29-2011, 04:12 PM
  3. PHP xmlapi.php has been updated to version 1.0.10
    By cPanelDavidN in forum cPanel Developers
    Replies: 0
    Last Post: 06-27-2011, 03:53 PM
  4. Strange behavior of Mysql::adddb (XMLAPI php class)
    By finitor in forum cPanel Developers
    Replies: 3
    Last Post: 05-31-2010, 04:11 AM
  5. PHP XMLAPI Docs
    By dquinney in forum cPanel Developers
    Replies: 3
    Last Post: 09-29-2007, 11:37 AM