Description
This function creates a subdomain.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
domain |
string |
Required The subdomain name to create. |
A valid subdomain name. |
subdomain |
rootdomain |
string |
Required The domain on which to create the new subdomain. |
A domain that already exists on the cPanel account. |
example.com |
dir |
string |
The subdomain's document root within your home directory. This parameter defaults to thepublic_html/subdomain_name value. |
A valid directory path, relative to the user's home directory. |
/public_html/directory_name |
disallowdot |
Boolean |
Whether to remove the dots (.) from thedomain value. This value defaults to 0. |
|
1 |
Returns
Return |
Type |
Description |
Possible values |
Example |
reason |
string |
A message of success or a reason for failure. |
A string that describes the success or error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |