I want to retrieve details of the users of our Marketing Cloud account using SOAP. Looked through the document and created the below SOAP envelop. It is working fine but does not retrieve the Associated Business Units and Roles for the users
What am I missing?
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">Retrieve</a:Action>
<a:MessageID>urn:uuid:5dfca442-f1a0-4f7c-9419-8ace5658d2a3</a:MessageID>
<a:ReplyTo>
<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">https://webservice.s6.exacttarget.com/Service.asmx</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-88b91f91-bac2-489b-90fb-37e7b256e20c-1">
<o:Username>xxx</o:Username>
<o:Password>xxx</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<ObjectType>AccountUser</ObjectType>
<QueryAllAccounts>true</QueryAllAccounts> // to enable child accounts
<Properties>email</Properties>
<Properties>ActiveFlag</Properties>
<Properties>CreatedDate</Properties>
<Properties>isAPIUser</Properties>
<Properties>UserID</Properties>
<Properties>LastSuccessfulLogin</Properties>
<AssociatedBusinessUnits>
<BusinessUnit>
<Properties>Name</Properties>
</BusinessUnit>
</AssociatedBusinessUnits>
<Roles>
<Role>
<Properties>Name</Properties>
</Role>
</Roles>
</RetrieveRequest>
</RetrieveRequestMsg>
</s:Body>
</s:Envelope>
Best Answer
You'll have to do another retrieve on the BusinessUnit object after you've retrieved AccountUser. I don't think the Roles are retrievable.
Here's a sample SOAP envelope from a live API call: