0

I wanted to get a list of all BUs and Users associated with those BU. For the BU I am using SOAP API as REST does not support it.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-32259181" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>xxx</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">yyy</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
  </soapenv:Header>
   <soapenv:Body>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>BusinessUnit</ObjectType>
            <Properties>Name</Properties>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>

The response which i am getting is about token (i am not using token).

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <soap:Header>
        <wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
        <wsa:MessageID>urn:uuid:98d322b3-5d9a-4a23-bac6-bab7cbed45eb</wsa:MessageID>
        <wsa:RelatesTo>urn:uuid:788a03dc-05e0-4427-9233-c23fd68c03ab</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
        <wsse:Security>
            <wsu:Timestamp wsu:Id="Timestamp-4fb1801f-7396-47ab-a421-12ce586ace5f">
                <wsu:Created>2020-06-15T14:12:52Z</wsu:Created>
                <wsu:Expires>2020-06-15T14:17:52Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <faultcode xmlns:q0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">q0:Security</faultcode>
            <faultstring>An invalid security token was provided</faultstring>
            <faultactor>https://mc44m84qcn2cdhgywd0dypw57gf8.soap.marketingcloudapis.com/Service.asmx</faultactor>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

Any clue on how to get BU and AccountUsers or making SOAP API work would be a great help.

1

It looks like you haven't got the authentication setup correct to work with the SOAP API. Have you followed the steps in this guide? The error message suggests it is the same as this previous question which was solved by following the steps listed.

1
  • 1
    @ChandrashekharDautpure Can you verify via comment what the actual fix was?
    – Matt Lacey
    Jun 16 '20 at 0:05

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.