0

I'm looking for endpoint URL to retrieve all users and roles in Marketing cloud.

Looking at REST API Documnetation, www.exacttargetapis.com/messaging/v1 should have users and roles GET Operation for users and roles, but I don't seem to find one. Please help.

Thanks

1
  • I will call this URL from Informatica cloud and store Response in Oracle table.
    – sfmcsyed
    Nov 21 '17 at 9:41
2

These are only accessible through SOAP API calls. You would have to query the account user and roles object.

To do this, make first make the SOAP call to the Account User object to retrieve the CustomerKey and use this to retrieve the corresponding roles .

Sample SOAP (Using Postman)

<?xml version="1.0" encoding="UTF-8"?>
<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:7e0cca04-57bd-4481-864c-6ea8039d2ea0</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">{{soapEndPoint}}</a:To>
      <fueloauth xmlns="http://exacttarget.com">{{accessToken}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
  <RetrieveRequest>
     <ObjectType>AccountUser</ObjectType>
     <QueryAllAccounts>true</QueryAllAccounts> 
     <Properties>CustomerKey</Properties>
  </RetrieveRequest>
  </RetrieveRequestMsg>
</s:Body>
 </s:Envelope>

Reference:

3
  • Can you post the soap call URL for retrieving Customerkey? Thanks
    – sfmcsyed
    Nov 22 '17 at 10:41
  • @sfmcsyed I have added this Nov 22 '17 at 10:47
  • I'm setting up service connector in informatica cloud which requires binding and operations fields for calling web service.
    – sfmcsyed
    Nov 22 '17 at 12:43
0

The above answer works fine. If you just wanted just the customer key for the user. If you need to retrieve the associated roles as well, then below SOAP request will work:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
   <soapenv:Header/>
    <soapenv:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
  <RetrieveRequest>
     <ObjectType>AccountUser</ObjectType>
     <QueryAllAccounts>true</QueryAllAccounts>
     <Properties>CustomerKey</Properties>
     <Properties>Roles</Properties>
     <Properties>DefaultBusinessUnit</Properties>
     <Properties>Email</Properties>
     <Properties>ActiveFlag</Properties>
  </RetrieveRequest>
  </RetrieveRequestMsg>
</soapenv:Body>
</soapenv:Envelope>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.