Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    1

    Default Help getting to Add a new Addon domain via PHP

    Hello,

    I want to allow my users to define an addon domain for their websites using a form. I have a VPS server with Cpanel, WHM and I am trying to create a PHP script that will just create this new addon domain in a seamless way to the user. So I am using CURL to authenticate and call the following URL (this is just an example):

    https://localhost:2083/xml-api/cpane...addaddondomain &cpanel_xmlapi_version=2&dir=<my_dir_editted_for_security>&newdomain=test.com&subdomain=alex.test.com

    However, I always get the same response: "Sorry, a main domain was not specified".

    Can someone please help me?

    Thank you!
    Alex

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: Help getting to Add a new Addon domain via PHP

    Hi Alex,

    I tried the following URL and it worked for me:
    Code:
    https://10.1.1.1:2083/xml-api/cpanel?cpanel_xmlapi_version=2&cpanel_xmlapi_module=AddonDomain&cpanel_xmlapi_func=addaddondomain&newdomain=alex.net&subdomain=alex.dave.com&dir=alex
    Are you authenticating your call as the user? (in my case it's "dave", how owns "dave.com"; in your case it would be the user who owns "alex.com"). If you authenticating as 'root', then you should use port 2087 and also provide the URL parameter "cpanel_xmlapi_user=$cpuser".

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

  3. #3
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: Help getting to Add a new Addon domain via PHP

    Also, if you're coding in PHP, you might consider using the PHP XML-API client class or the PublicAPI client class

    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

Similar Threads & Tags
Similar threads

  1. Unable to add an addon domain
    By pecito in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-08-2008, 08:21 AM
  2. Unable to add an addon domain
    By todd222222 in forum New User Questions
    Replies: 3
    Last Post: 05-03-2008, 01:04 AM
  3. DNS Zone Add -> Not displayed at CPanel Accound / Can't add addon-domain
    By Luerssen in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-02-2007, 08:50 PM
  4. Can't add an addon domain
    By keyDet79 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-08-2003, 06:15 PM
  5. How to add subdomain for addon domain?
    By johnlim9988 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-23-2003, 08:38 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube