Question about Remote API

Discussion in 'General' started by kinai, Nov 2, 2020.

  1. kinai

    kinai Member

    HI all,

    I'm looking for the better solution to retrieve all user's mailbox from a mail domain or a client using the remote api ?
    Any suggestion ?
    Thanks,
    Regards,
    Yannick
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Better than what?
    Is it a requirement to use the remote API so https://imapsync.lamiral.info/ is not sufficient?
     
  3. kinai

    kinai Member

    Better is not the correct word.
    I'm looking for the best way to retrieve all user's mailbox from a mail domain or a client using the remote api ?
     
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    See the remote API examples and documentation, you need to use the mail_user_get method to get mailbox info.
     
  5. kinai

    kinai Member

    I understand that I can pass an array as primary_id on this request.
    If I call email -> [email protected], I retrieve the email account.
    but I can't get emails account if I request *@domain.com
     
  6. kinai

    kinai Member

    Solved. mut be a SQL Syntax, so not *@domain.com but used %@domain.com
     
  7. kinai

    kinai Member

    hum ... I could'nt found a foreign key to retrieve domains from client (in client_get or mail_domain_get)

    Maybe with sys_groupid, but no method to retrieve link between sys_groupid and client_id
    No method also to retrieve client using another fields than the client_id
     
    Last edited: Nov 3, 2020
  8. kinai

    kinai Member

    Searching in the ISPConfig code, and found a method "client_get_groupid" that is not in the documentation. I'm going to test it.
     
  9. kinai

    kinai Member

    To the dev team, is it possible to integrate a "client_get" method with $primary_id at the same that other method to do search on all the field and not only the client_id. Currently, I have to get all clients (client_id = -1) and do the search on the result... not the better way...
     
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Checking some code here, I use client_get_id() to get the client_id from a sys_userid.
     
  11. kinai

    kinai Member

    if you have sys_userid ok ... but I wan't to get client un "customer_no"
     
  12. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Code:
    client_get($session_id, array('customer_no' => ID))
     
  13. kinai

    kinai Member

    Are you sure ? docs show method with client_id, not primary_id.
    I try this today.
     
  14. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    did you tried this? ;)
     
  15. kinai

    kinai Member

    Yes it's working, so this need some more docs on this subject ;)
     

Share This Page