List all websites via ISPConfig remote API

Discussion in 'Developers' Forum' started by todx, Apr 19, 2012.

  1. todx

    todx Member

    I'm assuming that when I access sites web_domain_list.php is executed?

    How can I use that from ISPConfig remote API?

    Anyway I'd like to list all website domain using ISPConfig remote API...
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please see remote API documnetation for a list of api functions, you find that in the remote_client/ API-docs/ folder of the ISPConfig tar.gz. All functions are described there incl. script examples.
     
  3. todx

    todx Member

    I've found the example, but that only allows retrieving one website at a time by providing the id
     
  4. todx

    todx Member

    Found a simple solution: =)

    PHP:
    $c=1;
    while(
    $domain_record $client->sites_web_domain_get($session_id$c)) {
         
    var_dump($domain_record);
         
    $c++;
    }
     
  5. david_hitt@lionlike.com

    [email protected] New Member

    Kinda late... but...

    Till showed me this one:

    Code:
    $domain_record = $client->sites_web_domain_get($session_id, [B]array('system_group' => 'client'.$client_id)[/B]);
    foreach ($domain_record as $domains) {
      echo $domains['domain']."<br>";
    }
    You can use "array('system_group' => 'client'.$client_id)" in place of $primary_id so it'll search the table field specified and match criteria.

    I just so happen to store the client_id in the interfacing system so I pull client_id from my local database, concat with 'client' and search the web_domains using 'system_group' which equals clientX.
     
  6. olaulau

    olaulau New Member

    PHP:
    $domain_record $client->sites_web_domain_get($session_id, []);
     

Share This Page