How to list all Parked Domains with cPanel API 2 ?

Killy123

Member
Oct 28, 2016
18
2
3
Bulgaria
cPanel Access Level
Root Administrator
I am creating new parked domain :
Code:
?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Park&cpanel_jsonapi_user=andreytestdom&domain=parkeddomainv1.com&topdomain=newaddondom&cpanel_jsonapi_func=park
But when I try to list only parked domains I get only these created thru the web UI :
Code:
?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Park&cpanel_jsonapi_user=andreytestdom&cpanel_jsonapi_func=listparkeddomains
response :
Code:
{
  "cpanelresult": {
    "apiversion": 2,
    "data": [
      {
        "basedir": "public_html",
        "dir": "/var/home/andreytestdom/public_html",
        "status": "not redirected",
        "domain": "andreytest33333.com",
        "reldir": "home:public_html"
      },
      {
        "domain": "newaliastest.com",
        "status": "http://alisatest.com",
        "reldir": "home:public_html",
        "dir": "/var/home/andreytestdom/public_html",
        "basedir": "public_html"
      },
      {
        "basedir": "public_html",
        "dir": "/var/home/andreytestdom/public_html",
        "status": "not redirected",
        "domain": "newaliastesta1.com",
        "reldir": "home:public_html"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Park",
    "func": "listparkeddomains"
  }
}
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,219
463
?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Park&cpanel_jsonapi_user=andreytestdom&domain=parkeddomainv1.com&topdomain=newaddondom&cpanel_jsonapi_func=park
Hello,

Could you let us know the output when you run this command? Also, review "topdomain=newaddondom" to determine if it's nessisary. It's only used when you are parking a domain name on an existing subdomain of the account. Thus, you'd enter "subdomain1" if "subdomain1" is added as a subdomain to the account.

Thank you.
 

Killy123

Member
Oct 28, 2016
18
2
3
Bulgaria
cPanel Access Level
Root Administrator
Hello,

Could you let us know the output when you run this command? Also, review "topdomain=newaddondom" to determine if it's nessisary. It's only used when you are parking a domain name on an existing subdomain of the account. Thus, you'd enter "subdomain1" if "subdomain1" is added as a subdomain to the account.

Thank you.
This is the response I get :
Code:
{
  "cpanelresult": {
    "data": [
      {
        "result": 1,
        "reason": "The system successfully parked (aliased) the domain “parkeddomainv1.com” on top of the domain “newaddondom.com”."
      }
    ],
    "event": {
      "result": 1
    },
    "apiversion": 2,
    "module": "Park",
    "func": "park"
  }
}
I reviewed "topdomain=newaddondom" , it is necessary.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,219
463
Hello,

It seems like the use of the "topdomain" parameter is resulting in the creation of an addon domain name instead of a parked domain. You can verify this by reviewing the output of the following command:

Code:
uapi --user=example DomainInfo list_domains
I've opened internal case CPANEL-9869 to report this behavior, and I'll update this thread with more information on the status of this case as it becomes available.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,219
463