cPanel api 2 and user interface difference for Parked Domains.

Killy123

Member
Oct 28, 2016
18
2
3
Bulgaria
cPanel Access Level
Root Administrator
When I run the following request thru the cPanel api2, I am parking the domain - "example112.com" on top of example111, which is previously created addon domain.
Code:
json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Park&cpanel_jsonapi_func=park&cpanel_jsonapi_user=exampleAccount&domain=example112.com&topdomain=example111
But when I try to add new domain thru the cPanel user interface at "frontend/paper_lantern/addon/index.html" with subdomain - "example111" the response is
"(XID p32zy2) A DNS entry for the domain “example111.cnodetest12.com” already exists.".Is this suppose to behave differently thru the api and the user interface?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
Hello,

You are parking (aliasing) a domain name through a cPanel API 2 function, and adding a new domain name via the cPanel UI as an addon domain name. If you wanted to park a domain name through the cPanel UI, you'd use the "Aliases" option.

Thank you.
 

Killy123

Member
Oct 28, 2016
18
2
3
Bulgaria
cPanel Access Level
Root Administrator
I am little confused here through cPanel UI "Aliases" is it possible to park a domain on top of "Addon domain"?I am able to add aliases only for the main domain in "Aliases" section.Is it in me the problem or the system works incorrectly?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
Hello,

I believe the confusion stems from the use of the "topdomain" parameter. Use of the "topdomain" parameter with the cPanel API 2 Park::park function to specify a subdomain actually results in the creation of an addon domain name. This is documented at:

cPanel API 2 Functions - Park::park - Software Development Kit - cPanel Documentation

topdomain parameter description:

The subdomain on which to park the domain parameter's domain.

If you specify a topdomain value, the function creates an addon domain under the subdomain that you specify.

If you do not specify a topdomain value, the function parks the domain domain on the cPanel account's main domain.

An existing subdomain name on the cPanel account. For example, subdomain if the subdomain is subdomain.example.com.
Thank you.
 

Killy123

Member
Oct 28, 2016
18
2
3
Bulgaria
cPanel Access Level
Root Administrator
Thank you, but I do not think the conversation is moving forward.When you use the "topdomain" parameter with value of already existing addon domain.The Api parks the new Parked domain on top of that domain, which already exists, you could try that easily.If you use the "topdomain" param with new non-existing addon domain it creates it.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
Thank you, but I do not think the conversation is moving forward.When you use the "topdomain" parameter with value of already existing addon domain.The Api parks the new Parked domain on top of that domain, which already exists, you could try that easily.If you use the "topdomain" param with new non-existing addon domain it creates it.
Hello,

I believe the term "parked" is what's leading to the confusion. For example, I ran the following command on a system where "example111.tld" (with example111 as the corresponding subdomain) exists as an addon domain name under the "cptest01" account:

Code:
cpapi2 --user=cptest01 Park park domain=example112.tld topdomain=example111
This setup "example112.tld" as an addon domain name under the "cptest01" account, not a parked domain (alias).

With addon domain names, you are not adding domain names on top of other domain names. You simply configure the document root to match your preference.

Thank you.