Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

SubDomain Module Documentation

This module allows users to control their subdomains.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

SubDomain::listsubdomains

API Version: 2 - Click here for documentation
Description: Retrieve a list of subdomains associated with a cPanel account.
Parameters:  
  regex (Regular Expression (optional))
  Regular expressions allow you to filter results based on a set of criteria.
Returns:  
 
<data>
  <domainkey> A string value that contains the domain key corresponding to the subdomain. (e.g. subdomain_example.com)</domainkey>
  <domain> A string value that contains the subdomain. (e.g. subdomain.example.com)</domain>
  <rootdomain> A string value that contains the main domain with which the subdomain is associated. (e.g. example.com)</rootdomain>
  <status> A string value that indicates whether the subdomain redirects to another domain.</status>
  <subdomain> A string value that contains the username that corresponds to the subdomain.</subdomain>
  <reldir> A string value that contains the relative path to the subdomain's document root. This value is prefixed by 'home:'. (e.g. home:public_html/sub)</reldir>
  <dir> A string value that contains the absolute path to the subdomain's document root. (e.g. /home/user/public_html/sub)</dir>
  <basedir> A string value that contains the relative path to the subdomain's document root. (e.g. public_html/sub)</basedir>
</data>

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>

SubDomain::addsubdomain

API Version: 2 - Click here for documentation
Description: Add a subdomain.
Parameters:  
  dir (string (optional))
  The subdomain's document root within your home directory. This value defaults to a directory of the same name as the subdomain in your public_html directory. (e.g. public_html/subdomain/ if the domain's name was subdomain.example.com).
  disallowdot (boolean (optional))
  If this parameter is enabled (set to '1'), it will automatically strip dots from the 'domain' value passed to this function.
  domain (string)
  The local part of the subdomain you wish to add. (e.g. 'sub' if the subdomain's is sub.example.com) This value should not include the domain with which the subdomain is associated.
  rootdomain (string)
  The domain to which you wish to add the subdomain.
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>

SubDomain::changedocroot

API Version: 2 - Click here for documentation
Description: Change the document root of a domain.
Parameters:  
  rootdomain (string)
  The main domain for the website whose document root you want to change.
  dir (string)
  The document root to which you want to move the subdomain.
  subdomain (string)
  The subdomain whose document root you want to change.
Returns:  
 
<data>
  <dir> A string value that contains the absolute path to the subdomain's document root. (e.g. /home/username/public_html/sub)</dir>
  <reason> A string that contains a success message or reason for failure.</reason>
  <reldir> A string value that contains the relative path to the subdomain's document root. This value is prefixed by 'home:'. (e.g. home:public_html/sub). </reldir>
  <result> A boolean value indicating success or failure. '1' if successful. '0' if failed.</result>
</data>

Topic revision: r3 - 10 May 2013 - 17:19:59 - Main.StacyWyatt