List all websites via ISPConfig remote API

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

  1. todx

    todx New 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 New Member

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

    todx New 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. 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.
     

Share This Page