Get Client Domains

Discussion in 'Developers' Forum' started by WHO, Nov 20, 2017.

  1. WHO

    WHO Member HowtoForge Supporter

    The "response" of sites_web_domain_get is always empty.
    The group_id (catched with "client_get_groupid") is correct and there is a domain in the table for sys_groupid (type vhost)
    Even if I pass domain_id directly or pass an empty array for domain_id , the response is still empty.
    Is there another filter in the function which can block possible results.
    Other functions work fine: client_add, client_get, sites_web_domain_add, ...
     
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    what about function domains_get_all_by_user($session_id, $group_id) ?
     
  3. WHO

    WHO Member HowtoForge Supporter

    domains_get_all_by_user works, but delivers the content of table "domain". I would like the content of "web_domain".
    Could using REST API causing that problem?
     
  4. florian030

    florian030 Well-Known Member HowtoForge Supporter

    i can use sites_web_domain_get($session_id, 525);
    or
    sites_web_domain_get($session_id,(array('domain' => 'example.com')));
    without any problems.
    for all web-domains on one server: sites_web_domain_get($session_id,(array('server_id' => '37')));
     
  5. WHO

    WHO Member HowtoForge Supporter

  6. florian030

    florian030 Well-Known Member HowtoForge Supporter

    restCall('sites_web_domain_get', array('session_id' => $session_id, 'primary_id' => array('server_id' => '37')));

    is the same as

    sites_web_domain_get($session_id,(array('server_id' => '37')));
     
  7. WHO

    WHO Member HowtoForge Supporter

    I found the problem:
    I used domain_id which is the primary instead of primary_id
    restCall("sites_web_domain_get", array('session_id' => $this->session_id, 'domain_id' => array('sys_groupid' => $this->client_group_id) ));
    Now:
    restCall("sites_web_domain_get", array('session_id' => $this->session_id, 'primary_id' => array('sys_groupid' => $this->client_group_id) )); is working
    thx a lot.
     
    Last edited: Nov 20, 2017

Share This Page