[SOLVED] Get list of users from distribution list using SOAP
I am trying to retrieve the list of users in a distribution list.
So far I was working out the following SOAP request to be sent to the server:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>0_.....</authToken>
<sessionId id=".....">.....</sessionId>
</context>
</soap:Header>
<soap:Body>
<SearchDirectoryRequest xmlns="urn:zimbraAdmin"
offset="0" limit="2000"
sortBy="name" sortAscending="1"
attrs="displayName,zimbraId,zimbraMailHost,uid,description,zimbraMailStatus,zimbraMailForwardingAddress"
types="distributionlists">
<query xmlns="">zimbraMailAlias=it@example.com</query>
</SearchDirectoryRequest>
</soap:Body>
</soap:Envelope>
The problem is, that this returns in the SOAP response also the aliases which are defined for users.
Could anybody give me a hint how to modify the query to get only "objectClass=zimbraAccount"?
[SOLVED] Get list of users from distribution list using SOAP
I created a workaround by handling the response:
1. extracting all zimbraId's and
2. doing "array_unique" in PHP
If anybody would have a more efficient way...