DomainInfo
Domain Information
Return domain's hosting configuration
This function lists user data for a domain.
Important:
This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain.
- Because aliases (parked domains) do not use a user data file, this function cannot query information for aliases. To retrieve information for an alias, specify the associated main or addon domain.
- Due to differences in user data files, the function's actual output may not contain all of the returns that this document lists.
get/DomainInfo/single_domain_data
Query parameters
domainstring domain required
Example:example.com
The domain on the cPanel account.
Important:
Do not specify an alias (parked domain).
hide_temporary_domains1 | 0
Example:1
Whether to hide temporary domains from the returned values.
- 1 — Return an error if the requested domain is a temporary domain.
- 0 — Return all domains, including the temporary domains.
Note:
If you set this parameter's value to 1 and the requested domain is temporary, the function will return an error similar to the following example: Domain [example.com] is a temporary domain and hide_temporary_domains is enabled.
return_https_redirect_status0 | 1
Example:1
Whether to return the secure redirect status of the addon domains.
- 1 - Return status.
- 0 - Do not return status.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "single_domain_data",
"module": "DomainInfo",
"result": {
"data": {
"customlog": {
"domain": "combined",
"target": "/usr/local/apache/domlogs/example.com"
},
"documentroot": "/home/user/public_html/",
"domain": "example.com",
"group": "user",
"hascgi": 1,
"homedir": "/home/user",
"ifmodulemodsuphpc": {
"group": "user"
},
"ip": "192.168.0.128",
"options": "ExecCGI Includes",
"owner": "root",
"phpopenbasedirprotect": 1,
"port": 80,
"scriptalias": {
"path": "/home/user/public_html/cgi-bin",
"url": "/cgi-bin/"
},
"serveradmin": "webmaster@example.com",
"serveralias": "parkeddomain.com www.parkeddomain.com www.example.com",
"servername": "example.com",
"type": "main_domain",
"usecanonicalname": "Off",
"user": "user",
"userdirprotect": 1
},
"status": 1
}
}