1

We want to unsubscribe a user from a list using the SOAP API. Deleting the user works, but setting the status unsubscribed does not.

here is what we tried:

<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>
  <ns1:fueloauth xmlns:ns1="http://exacttarget.com">{{token}}</ns1:fueloauth>
</soapenv:Header>
<soapenv:Body>
    <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Objects xsi:type="Subscriber">
             <EmailAddress>[email protected]</EmailAddress>
             <SubscriberKey>[email protected]</SubscriberKey>  
             <Lists>
                <ID>42</ID>
                <Action>Unsubscribed</Action>
             </Lists>
        </Objects>
    </UpdateRequest>
</soapenv:Body>
</soapenv:Envelope>

Is it simply changing the action or is there more involved? Cant really find it in the docs.

1
  • Thinking out loud... What about updating the List and the Subscriber, not just the list?
    – Timothy
    Commented Oct 27, 2014 at 16:50

2 Answers 2

0

Please try adding SaveOptions with SaveAction of 'UpdateAdd' and PropertyName of * (star)

See link [http://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/updating_an_existing_subscriber_using_the_create_method_with_updateadd/][1]

Try this & let us know if this works.

So sample SOAP

<soapenv:Body>
    <Options>  
                <SaveOptions>  
                    <SaveOption>  
                        <PropertyName>*</PropertyName>  
                        <SaveAction>UpdateAdd</SaveAction>  
                    </SaveOption>  
                </SaveOptions>  
            </Options>  
    <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <Objects xsi:type="Subscriber">
             <EmailAddress>[email protected]</EmailAddress>
             <SubscriberKey>[email protected]</SubscriberKey>  
             <Lists>
                <ID>42</ID>
                <Action>Unsubscribed</Action>
             </Lists>
        </Objects>
    </UpdateRequest>
</soapenv:Body>
2
  • Above did not worked but forced me to dig deeper. In the end it was solved by adding a status to the list.
    – Danler
    Commented Oct 28, 2014 at 8:40
  • oh yes.. The field should have been <status> opposed to <action>. Didn't even notice that. Glad it's resolved. Commented Oct 28, 2014 at 20:01
0

Adding a simple Status solved this question.

<UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
    <Objects xsi:type="Subscriber">
         <EmailAddress>[email protected]</EmailAddress>
         <SubscriberKey>[email protected]</SubscriberKey>  
         <Lists>
            <ID>42</ID>
            <Status>Unsubscribed</Status>
            <Action>update</Action>
         </Lists>
    </Objects>
</UpdateRequest>

You must log in to answer this question.

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