1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Get Domain Alias Information Using API

Discussion in 'Plesk Expand 2.3 General Discussion' started by eugenevdm, Mar 16, 2009.

  1. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    I'm trying to retrieve Plesk Expand Domain Alias information.

    My goal is to determine if a domain alias already exists in Expand.

    I'm doing this:
    Code:
    $domain = "testdomain.com";
    $operator = "exp_plesk_domainalias";
    $data = <<<EOF
    <?xml version="1.0" encoding="UTF-8"?>
    	<packet version="2.3.1.8">
    	     <get>
    	          <filter>
    	               <name>$domain</name>	               
    	          </filter>	          
    	          <dataset>
    	          	<gen_info/>
    	          </dataset>
    	     </get>
    	</packet> 
    EOF;
    
    The above code works for a domain but not for an alias.
    The <name> tag is rejected.

    The end-value that I am interested in is the domain alias ID. I want to retrieve the domain alias ID based on the domain name. Otherwise if I can't get the ID I just need to know if the alias exists or not.

    I see in the API protocol reference here:
    http://download1.parallels.com/Plesk/Expand/latest/doc/expand-2.3-api/index.htm

    plesk_domain_alias // server_id // name

    I cannot use this because I do not know the server ID, I only know the domain name ..

    Please assist.
     
  2. gold

    gold Regular Pleskian

    25
    57%
    Joined:
    Jan 8, 2008
    Messages:
    307
    Likes Received:
    0
    You can get the domain ID by domain name using exp_plesk_domain operator then get the domain aliases for this domain using the <domain_id> tag.
     
  3. eugenevdm

    eugenevdm Silver Pleskian

    30
    68%
    Joined:
    Nov 11, 2003
    Messages:
    611
    Likes Received:
    0
    Is there an API call to find an alias exists?

    For example, I want to search the whole Expand system for an alias "myalias.com"?
     
Loading...