Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Default create FTP, email and remove a parked domain using xml api

    Hi

    Does anyone know how to create a ftp/email account using xml api?
    also would you able to tell me which function remove a parked domain?


    Cheers,

  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 nhk15 View Post
    Hi

    Does anyone know how to create a ftp/email account using xml api?
    also would you able to tell me which function remove a parked domain?


    Cheers,
    Here's a thread on parking a domain:

    http://forums.cpanel.net/showthread.php?t=69519

    To unpark a domain, simply use the unpark function instead of the park function. The syntax is the same.

    To create an email account, use the addpop function described in this thread:

    http://forums.cpanel.net/showthread.php?t=89749

    To create a FTP account, use this API1 function:

    Code:
    <cpanel Ftp="addftp(login, password, homedir, quota,,homedir)">
    login = FTP username without @domain (cPanel adds that automatically)
    password = FTP password
    homedir = directory to which the FTP account has access
    quota = FTP user's quota in megabytes

    The above threads explain how to call API1 functions from the XML API, but we also have documentation for that at http://cPanel.net/plugins/xmlapi

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default

    Hi,
    I´ve got the following result, if i try to add a FTP-Account:
    Code:
    <fatalerror>[a fatal error or timeout occurred while processing this directive]</fatalerror><fatalerror>[a fatal error or timeout occurred while processing this directive]</fatalerror>
    My call:
    Code:
    https://xxxxx:2087/xml-api/cpanel?user=xxxxx&xmlin=<cpanelaction>
    <module>Ftp</module>
    <func>addftp</func>
    <apiversion>1</apiversion>
    <args>user1</args>
    <args>asdfölkj123</args>
    <args>/</args>
    <args>4700</args>
    </cpanelaction>
    Is the Module-Name wrong ?
    Where is the error ?

    Thank you for helping.

  4. #4
    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 clusterkiller View Post
    Hi,
    I´ve got the following result, if i try to add a FTP-Account:
    Code:
    <fatalerror>[a fatal error or timeout occurred while processing this directive]</fatalerror><fatalerror>[a fatal error or timeout occurred while processing this directive]</fatalerror>
    My call:
    Code:
    https://xxxxx:2087/xml-api/cpanel?user=xxxxx&xmlin=<cpanelaction>
    <module>Ftp</module>
    <func>addftp</func>
    <apiversion>1</apiversion>
    <args>user1</args>
    <args>asdfölkj123</args>
    <args>/</args>
    <args>4700</args>
    </cpanelaction>
    Is the Module-Name wrong ?
    Where is the error ?

    Thank you for helping.
    I actually copy/pasted your URL, placed it on a single line and substituted a username and hostname and it worked fine for me. So I recommend seeing if updating your cPanel/WHM fixes this. Also, if you are using port 2087, make sure you are logged in as a reseller user (or root user). If you only have cPanel access, you can use ports 2082 and 2083 instead for the XML API.

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

    Default

    When that happens, what is in /usr/local/cpanel/logs/error_log?
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  6. #6
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default

    Quote Originally Posted by cPanelMatt View Post
    When that happens, what is in /usr/local/cpanel/logs/error_log?
    Hello,

    The logfile give the following output (with xml-api executed as root-user):
    Code:
    (internal death while parsing ) Fri Apr 10 13:24:06 2009 [16332] error:
    not well-formed (invalid token) at line 1, column 107, byte 107 at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser.pm line 187
     at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser/Expat.pm line 478
            XML::Parser::Expat::parse('XML::Parser::Expat=HASH(0x152a8970)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser.pm line 187
            eval {...} called at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser.pm line 186
            XML::Parser::parse('XML::Parser=HASH(0x15298ab0)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/XML/SAX/Expat.pm line 60
            XML::SAX::Expat::_parse_string('XML::SAX::Expat=HASH(0x150e03e0)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/XML/SAX/Base.pm line 2602
            XML::SAX::Base::parse('XML::SAX::Expat=HASH(0x150e03e0)', 'HASH(0x15353890)') called at /usr/lib/perl5/site_perl/5.8.8/XML/SAX/Base.pm line 2655
            XML::SAX::Base::parse_string('XML::SAX::Expat=HASH(0x150e03e0)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 370
            XML::Simple::build_tree('XML::Simple=HASH(0x150799c0)', 'undef', 'SCALAR(0x14fa0280)') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 308
            XML::Simple::build_simple_tree('XML::Simple=HASH(0x150799c0)', 'undef', 'SCALAR(0x14fa0280)') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 270
            XML::Simple::parse_string('XML::Simple=HASH(0x150799c0)', 'SCALAR(0x14fa0280)') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 171
            XML::Simple::XMLin('SCALAR(0x14fa0280)') called at /usr/local/cpanel/Cpanel/XMLParser_ExtPerlMod.pm line 20
            Cpanel::XMLParser_ExtPerlMod::XMLin('HASH(0x14e46fe0)') called at - line 5
    
    
    (internal death while parsing ) Fri Apr 10 13:24:06 2009 [16332] error:
    not well-formed (invalid token) at line 1, column 107, byte 107 at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser.pm line 187
     at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser.pm line 192
            XML::Parser::parse('XML::Parser=HASH(0x15298ab0)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/XML/SAX/Expat.pm line 60
            XML::SAX::Expat::_parse_string('XML::SAX::Expat=HASH(0x150e03e0)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/XML/SAX/Base.pm line 2602
            XML::SAX::Base::parse('XML::SAX::Expat=HASH(0x150e03e0)', 'HASH(0x15353890)') called at /usr/lib/perl5/site_perl/5.8.8/XML/SAX/Base.pm line 2655
            XML::SAX::Base::parse_string('XML::SAX::Expat=HASH(0x150e03e0)', '<cpanelaction><module>Ftp</module><func>addftp</func><apivers...') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 370
            XML::Simple::build_tree('XML::Simple=HASH(0x150799c0)', 'undef', 'SCALAR(0x14fa0280)') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 308
            XML::Simple::build_simple_tree('XML::Simple=HASH(0x150799c0)', 'undef', 'SCALAR(0x14fa0280)') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 270
            XML::Simple::parse_string('XML::Simple=HASH(0x150799c0)', 'SCALAR(0x14fa0280)') called at /usr/lib/perl5/site_perl/5.8.8/XML/Simple.pm line 171
            XML::Simple::XMLin('SCALAR(0x14fa0280)') called at /usr/local/cpanel/Cpanel/XMLParser_ExtPerlMod.pm line 20
            Cpanel::XMLParser_ExtPerlMod::XMLin('HASH(0x14e46fe0)') called at - line 5
    
    
    
    not well-formed (invalid token) at line 1, column 107, byte 107 at /usr/lib/perl5/site_perl/5.8.8/x86_64-linux/XML/Parser.pm line 187
    (internal death while parsing ) Fri Apr 10 13:24:06 2009 [16330] error: File is not a perl storable at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 398.
            eval {...} called at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 398
            Storable::fd_retrieve('GLOB(0x2b519afa8060)') called at /usr/local/cpanel/Cpanel/ExtPerlMod.pm line 58
            Cpanel::ExtPerlMod::func('Cpanel::XMLParser_ExtPerlMod::XMLin', 'HASH(0x21a4ea0)', 1) called at /usr/local/cpanel/Cpanel/XMLParser.pm line 32
            Cpanel::XMLParser::XMLin('SCALAR(0x220f470)') called at cpanel.pl line 1506
            eval {...} called at cpanel.pl line 1506
            main::docpanelaction('<cpanelaction><module>Ftp</module><func>addftp</func><apiversion...') called at cpanel.pl line 4750
            main::dotag(undef) called at cpanel.pl line 4625
            main::cpanel_parseblock('SCALAR(0x232ffc0)') called at cpanel.pl line 1223
    
    
    (internal death while parsing ) Fri Apr 10 13:24:06 2009 [16330] error: File is not a perl storable at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 398, at /usr/local/cpanel/Cpanel/ExtPerlMod.pm line 58
            Carp::croak('File is not a perl storable at /usr/lib/perl5/site_perl/5.6.2/x8...') called at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 76
            Storable::logcroak('File is not a perl storable at /usr/lib/perl5/site_perl/5.6.2/x8...') called at /usr/lib/perl5/site_perl/5.6.2/x86_64-linux/Storable.pm line 399
            Storable::fd_retrieve('GLOB(0x2b519afa8060)') called at /usr/local/cpanel/Cpanel/ExtPerlMod.pm line 58
            Cpanel::ExtPerlMod::func('Cpanel::XMLParser_ExtPerlMod::XMLin', 'HASH(0x21a4ea0)', 1) called at /usr/local/cpanel/Cpanel/XMLParser.pm line 32
            Cpanel::XMLParser::XMLin('SCALAR(0x220f470)') called at cpanel.pl line 1506
            eval {...} called at cpanel.pl line 1506
            main::docpanelaction('<cpanelaction><module>Ftp</module><func>addftp</func><apiversion...') called at cpanel.pl line 4750
            main::dotag(undef) called at cpanel.pl line 4625
            main::cpanel_parseblock('SCALAR(0x232ffc0)') called at cpanel.pl line 1223
    
    
    2009-04-10 11:24:06 info [cpanel] xml-api/cpanel call failed. Module name is required.
    cPanel is up2date.

    Thank you for reply.

Similar Threads & Tags
Similar threads

  1. Replies: 2
    Last Post: 08-04-2011, 08:58 AM
  2. Cannot Create New Email Accounts with XML API Script
    By christsealed in forum E-mail Discussions
    Replies: 1
    Last Post: 04-30-2011, 06:48 PM
  3. Replies: 0
    Last Post: 04-20-2010, 03:37 PM
  4. XML API for Addon Domain Redirection
    By intrwrks in forum cPanel Developers
    Replies: 0
    Last Post: 12-11-2009, 08:14 AM
  5. Way to create MySql DB with XML-API?
    By dudely in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-27-2007, 11:42 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube