check existence of domain in ispconfig remoting

Discussion in 'ISPConfig 3 Priority Support' started by saco721, Aug 16, 2017.

  1. saco721

    saco721 Member

    I have ISPConfig 3.1.6 on debian Jessie multiserver setup.
    I am trying to create a script that adds a new domain for a client using remoting api : domains_domain_add.php, but was wondering how I prevent a new domain from being added if it has not been registered yet. For example add domain, if the domain doesn't exist yet, show some kind of error message, and if it does exist then add the new domain in ispconfig. Any advice is greatly appreciated, thanks.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Check if the domain exists already with:

    $domain_record = $client->sites_web_domain_get($session_id, array('domain' => 'yourdomain.tld'));
  3. saco721

    saco721 Member

    Thanks Till.

Share This Page