API client_get -> sites_web_domain_get

Discussion in 'Developers' Forum' started by M. Piscaer, May 23, 2018.

  1. M. Piscaer

    M. Piscaer New Member

    For invoicing I try to get the hosting information via de API. I now the client_ids but I don't know what client has what domain. I the database I found the relation table sys_group. But how can I do that via the API?

    With client_get_all I can get all the client_ids, with client_get(client_id), I can get the specific client information.
    With the client_id I can get the related groupid and with the groupid I can get the related domain_ids. And with sites_web_domain_get(domain_id) I have the domain information.
    In the database the relation between client and site is linked via the table sys_group. But how can I find this relation via the API?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is a function functions go get the groupid from client_id in the api and you can use the group_id in all _get functions to query records.
     
  3. M. Piscaer

    M. Piscaer New Member

    If I do a
    {"session_id": "fadba2d5d0edea01665d6ecc87df5d0c", "primary_id": {"client_id": "1"}} to the REST API on ispconfig.local:8080/remote/json.php?sites_web_domain_get I get {"code":"ok","message":"","response":[]}

    So probably I don't use the correct function. What is the function that I need to use to get the group_id?
     
  4. M. Piscaer

    M. Piscaer New Member

    After multiple times searching, I found client_get_groupid. I think this does the trick.
     
  5. Javi

    Javi New Member

    Thanks so much M. Piscaer.
    That's the function that I was looking for.
     

Share This Page