1

Is there a way to Activate a Master Unsubscribe using the SOAP/REST API?

We are using the update method (UpdateAdd) with SOAP API. It works when a user is activated or subscribed to one or more lists, However if a user unsubscribes from all lists in the account (SMC calls this "Master Unsubscribe"- an administrator has to click on the "Activate" button to add the user back- the user is still a subscriber but is "deactivated"), the UpdateAdd fails in this case and it does this quietly - i.e: without sending back a fault exception. The subscriber is still completely unsubscribed from all lists. So the update/updateAdd method does nothing when a user is "Master Unsubscribed".

Here is a sample SOAP request and response (abbreviated):

abbreviated request
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> 
<env:Header><fueloauth xmlns="http://exacttarget.com">{{fuelOath token}} 
</fueloauth></env:Header>
<env:Body>
<ns2:CreateRequest xmlns:ns2="http://exacttarget.com/wsdl/partnerAPI" 
xmlns:ns3="urn:fault.partner.exacttarget.com">
<ns2:Options>
    <ns2:SaveOptions>
            <ns2:SaveOption>
            <ns2:PropertyName>*</ns2:PropertyName>
        <ns2:SaveAction>UpdateAdd</ns2:SaveAction>
            </ns2:SaveOption>
        </ns2:SaveOptions>
    </ns2:Options>
    <ns2:Objects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="ns2:Subscriber">
    <ns2:EmailAddress>{{subscriber email}}</ns2:EmailAddress> 
   <ns2:SubscriberKey>{{subscriber key}}</ns2:SubscriberKey>
        <ns2:Lists><ns2:ID>7026</ns2:ID>
        <ns2:Status>Active</ns2:Status>
        </ns2:Lists>
    <ns2:Lists>
    <ns2:ID>7027</ns2:ID>
    <ns2:Status>Unsubscribed</ns2:Status>
    </ns2:Lists>
    </ns2:Objects>
    </ns2:CreateRequest>
    </env:Body></env:Envelope>

abbreviated response
<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>CreateResponse</wsa:Action>
        <wsa:MessageID>urn:uuid:911fd420-0e90-4a1b-a6eb- 
   398a197e1f18</wsa:MessageID>
        <wsa:RelatesTo>urn:uuid:bbf97a59-ac07-46d2-a4ed- 
   2d9c3afaae78</wsa:RelatesTo><wsa:To>

    http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
            <wsse:Security><wsu:Timestamp wsu:Id="Timestamp-6f0d74d2-48d6- 
   4c84-a4b0-f3a69b487faf">
            <wsu:Created>2018-09-21T18:46:38Z</wsu:Created> 
   <wsu:Expires>2018-09-21T18:51:38Z</wsu:Expires></wsu:Timestamp> 
           </wsse:Security>
            </soap:Header>
        <soap:Body>
          <CreateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI"> 
   <Results> 
       <StatusCode>OK</StatusCode>
            <StatusMessage>Created Subscriber.</StatusMessage> 
       <OrdinalID>0</OrdinalID><NewID>51613212</NewID><Object 
    xsi:type="Subscriber">
        <PartnerKey xsi:nil="true"/><ID>51613212</ID><ObjectID 
xsi:nil="true"/> 
   <Email
        Address>{{subscriber email}}</EmailAddress><SubscriberKey> 
   {{subscriber 
        key}}
            </SubscriberKey>
            <Lists><PartnerKey xsi:nil="true"/>
            <ID>7026</ID><ObjectID xsi:nil="true"/><Status>Active</Status> 
   </Lists> 
       <Lists><PartnerKey xsi:nil="true"/>
            <ID>7027</ID><ObjectID xsi:nil="true"/> 
<Status>Unsubscribed</Status> 
       </Lists></Object></Results>
            <RequestID>a3135161-407a-4f01-846b-5f74edd7f26f</RequestID> 
        <OverallStatus>OK</OverallStatus>
          </CreateResponse>
        </soap:Body></soap:Envelope>]
  • 2
    Is this a marketing cloud question? If so, please tag it as such. If not, that's fine as well. Just clarifying. – Daniel Ballinger Sep 22 '18 at 7:01
  • What is the difference between List ID 7026 and 7027? Is 7026 the All Subs list and 7027 a standard list? Are you at DF18? Happy to sit down and look at this together, if you're here. – Eliot Harper Sep 25 '18 at 0:40
  • These are publication lists. The subscriber (who is a member of All Subs list) belongs to all these lists but is not necessarily subscribed to any of them. I won't be at DF18 but thanks for the offer. – Glen Sep 25 '18 at 2:49
  • I've also tried this passing the list id of the All Subs list with the "Active" status - the result is the same (No change). Is anyone using a web page for subscribers to unsubscribe or subscribe to lists using SMC's SOAP API ? – Glen Sep 28 '18 at 0:29
0

You will have to use the SOAP API as the REST API doesn't currently support this.

https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/update_a_subscriber.htm

You can use an update method to update the status of the subscriber object.

  • We are already using the update method- sorry I should have clarified that in my question. – Glen Sep 24 '18 at 15:01
0

I'm not completely sure what you are trying to achieve from reading your question, but I believe you are trying to re-subscribe a Subscriber on the All Subscribers List. Here's an approach you can use.

You will need to know a couple of attributes in order to use this method (in addition to the OAuth access token):

  1. Your SOAP Endpoint Link
  2. The List ID of your All Subscribers list.

The List ID of the All Subscribers list will never change and the quickest way to obtain this is by hovering over the All Subscribers menu item in the tree interface (using Chrome) and review the JavaScript function that appears in the bottom left corner of the window:

obtaining List ID

In the screenshot above, the List ID of the All Subscribers List is 764. Use whatever value your List ID is as the {{ListID}} value in the SOAP request below.

Here's a working example (which you can try in Postman).

POST {{soapEndpoint}}
Content-Type: text/xml

<?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">Update</a:Action>
        <a:To s:mustUnderstand="1">{{soapEndpoint}}</a:To>
        <fueloauth xmlns="http://exacttarget.com">{{accessToken}}</fueloauth>
    </s:Header>
    <s:Body
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <Objects xsi:type="Subscriber">
                <SubscriberKey>{{insertSubscriberKey}}</SubscriberKey>
                <Lists>
                    <ID>{{ListID}}</ID>
                    <Status>Active</Status>
                    <Action>Update</Action>
                </Lists>
            </Objects>
        </UpdateRequest>
    </s:Body>
</s:Envelope>
  • Hi Eliot, This is essentially what we already do. I've appended to my question a sample SOAP request. – Glen Sep 24 '18 at 19:38
  • I also added the soap response. Note that the response statusMessage states that the subscriber was created- this is odd as the subscriber already exists in the All Subscribers list. - the subscriber is just unsubscribed and needs to be "activated" via the SOAP API call. If the subscriber does not get "activated", any SOAP request to update subscriptions is ignored. – Glen Sep 24 '18 at 20:17

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.