I am building a custom Integration between Sales Cloud and Marketing Cloud using the LogUnsubEvent call to unsubscribe a subscriber and get the metrics updated correctly on the reports providing the JobId. Parent Business unit with many childs.

I have build the request successfully, but when starting to test it (From salesforce itself and Postman) I noticed that the Subscriber is not being unsubscribed at all, even thought I get a Success response from the server and I am providing the required information in the request.

Response :

<?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">
            <wsu:Timestamp wsu:Id="Timestamp-2f21aa1b-b881-43cc-9c55-54aa175b9fa5">
        <UpdateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <RequestID---REQUEST ID----</RequestID>

I have been through the documentation and through other posts to see if I am missing something, but I after going through my code and request over and over again, I am not able to see what is missing.


<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">---Password----</Password>
     <ExecuteRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
                    <Value>[email protected]</Value>

Just in case you want to check my header parameters too:

private static String makeHTTPXMLPost(String endPoint, String soapBody){
    Http h = new Http();
    HttpRequest r = new HttpRequest();
    r.setHeader('SOAPAction', 'Update');
    r.setClientId('ID' , '100014439');
    HttpResponse s = h.send(r);
    System.debug('response' + s.getBody());
    return s.getBody();

1 Answer 1


So good news that is also bad news. It is a very tiny thing, but it is breaking the whole call.

You have the SOAPAction in your header as 'Update' and it should be 'Execute'.

Once you change this, it should work as expected.

A way to check this without looking at the header each time is to look at the response received and make sure the Response type matches the type you sent.

E.g. you sent ExecuteRequest but received UpdateResponse.

  • Well that 'Execute' was the source of the breaking after all. Thanks for pointing that out, I was convinced that the issue was on the Request XML.
    – Pbird
    Dec 11, 2019 at 9:27
  • @Pbird, If this solves your issue please be sure to mark the check box next to my answer to allow an easy reference for anyone else facing the same issue. Thanks and glad you figured it out! Dec 11, 2019 at 14:30
  • @Gortonington - a follow up Q here. Once this call is successful, do you expect to see an Unsubscribe recorded under Send >> Tracking for that JOBID?
    – Maneesh
    Oct 13, 2022 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .