0

I'm trying to send a SOAP request to the Marketing Cloud API so I can unsuscribe a person from a list but the response always is "Bad Request".

Here is the request I'm sending:

<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>
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <UsernameToken>
        <Username>--USERNAME--</Username>
        <Password>--PASSWORD--</Password>
      </UsernameToken>
    </Security>
  </soapenv:Header>
  <soapenv:Body>
    <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <Objects xsi:type="Subscriber">
        <EmailAddress>--PERSON EMAIL TO UNSUSCRIBE--</EmailAddress>
        <Lists>
          <PartnerKey xsi:nil="true"/>
          <ID>59</ID>
          <Status>Unsubscribed</Status>
          <Action>Update</Action>
        </Lists>
      </Objects>
    </UpdateRequest>
  </soapenv:Body>
</soapenv:Envelope>

Method: POST
The endpoint is: https://XXXXXXX.soap.marketingcloudapis.com/Service.asmx

And the parameters in the header are:
Content-Type:text/xml
SOAPAction:Update
Accept:text/xml
Charset:UTF-8

Can someone tell me what I'm doing wrong please?

4
  • Have you enabled username and password API authentication in Security Settings? Nov 21, 2019 at 20:52
  • Have you validated your call in like soap UI?
    – EazyE
    Nov 21, 2019 at 21:39
  • 1
    Also have you tried leveraging this example: developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/…
    – EazyE
    Nov 21, 2019 at 21:51
  • If you have than one BU it can also be a missing clientId.. so now you have lots of stuff to check.. get back to us with any news :)
    – DonL
    Nov 22, 2019 at 14:46

1 Answer 1

0

In the header, could you try this ->

Content-Type : text/xml; charset="utf-8"
SOAPAction : Update
0

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.