Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jul 2010
    Posts
    22

    Question API addon domain issue - "I do not believe you control the subdomain"

    Part of my web app takes a URL from the user, checks to make sure that its nameservers are pointed at our server, and if so adds it (via PHP and the XML API) to our server as an addondomain. This is all set up and working properly, though I keep running into issues and I can't figure out if I'm having them because I'm testing with the same domain over and over (add it through my web app, then log into cPanel UI and manually delete it, repeat) or what is happening.

    The issue I'm currently having:
    1. I go into cPanel, remove the addon domain I'm testing with so I'm starting "fresh" (I'm sure there are traces related to the domain still in files on the server, but don't think it should matter because it's the same setup every time).
    2. Then I go to my web app, use the function to add my domain as an addon domain and it works fine. I can verify by going back to the cPanel UI and now I can find it again in the addon domains section.
    3. Now I go to the part of my web app where users can delete their domain (does some internal DB querying and then uses cPanel API to remove the addondomain). Here's where I run into trouble. When I try to delete the addon domain using the API2 AddonDomain::deladdondomain function, I get this error:
    Error from park wrapper: Sorry, I do not believe you control the subdomain for domain.com
    When the deladdondomain function gets called it's with the same user/pass I used to create it, which is what confuses me. Could someone explain this?

    I did plenty of research before posting here and I see a lot of people suggest editing all sorts of apache config files...I tried that solution, it didn't really help and I almost ended up deleting all of my server's hundreds of addon domains!

    Thanks!

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

    Default

    Hi rlesterphx,

    I know you said you've done your homework, and I don't mean to question you, but just to be sure that we're on the same page:

    In your API deladdondomain call, the "subdomain" argument you're passing, it is it the "domain_key", right?

    from ApiAddonDomain < ApiDocs/Api2 < TWiki
    subdomain (string)

    This value should contain both the username and main domain that correspond to the addon domain. (e.g. 'username_maindomain.com') This value is also known as the domainkey. You can obtain this value using AddonDomain::listaddondomains.
    I bring this up not because it's a common mistake, but because I know there was incorrect documentation for this particular call, which got fixed about a month ago. The current documentation (which I've linked above) is correct.

    Just let me know and we'll try and get this figured out.

    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
    Member
    Join Date
    Jul 2010
    Posts
    22

    Thumbs up Solved

    Thank you so much, DavidN. That was it.
    I guess I missed that part in the doc explaining the domainkey thing, or maybe I looked it up before that edit was made.
    I was having a similar issue before with the SubDomain::delsubdomain function and after some snooping around and debugging figured out that the "domain" variable needed to be in that "subdomain_maindomain.com" format (you should probably update that doc too and note it).

    Thanks again!

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

    Default

    No Problem! Glad it was as simple as that. I'm making an internal report to verify the documentation on SubDomain::delsubdomain right now. Thanks for the heads up.

    Regards,
    -DavidN


    UPDATE
    Concerning API2's SubDomain::delsubdomain: I've test the call via XML-API in WHM/cPanel 11.27.77 and it works as expected (per existing documentation). So either the reported issue is a bug or some other arbitrary environment issue that is not know (from the brief discussion here); fonder for another thread or support ticket.

    Permutations that worked to delete asub.mydomain.net
    Code:
    'asub.mydomain.net'
    'asub'
    'asub.mydomain.net_mydomain.net'
    Existing documentation
    SubDomain::delsubdomain
    API Version: 2 - Click here for documentation
    Description: Delete a subdomain.
    Parameters:
    domain (string)
    The subdomain you wish to delete.
    Returns:

    <data>
    <reason> A string that contains a success message or reason for failure.</reason>
    <result> A boolean value indicating success or failure. '1' if successful. '0' if failed.</result>
    </data>
    If that doesn't work for someone, please open a new thread with an appropriate title (ie, SubDomain::delsubdomain) or open a support ticket.

    Best 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

Similar Threads & Tags
Similar threads

  1. API addon domain issue - "I do not believe you control the subdomain"
    By rlesterphx in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-08-2010, 03:35 AM
  2. Replies: 3
    Last Post: 07-22-2010, 07:09 PM
  3. Replies: 1
    Last Post: 12-22-2008, 07:02 PM
  4. How to NOT create "subdomain" with each addon domain
    By merm in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-24-2006, 08:06 AM
  5. Replies: 1
    Last Post: 01-17-2006, 07:02 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube