2

I see the documentation for deleting a subscriber from a list in the xml api docs:

https://help.exacttarget.com/en/technical_library/xml_api/xml_api_calls_and_sample_code/subscriber_management/subscriber_delete/

is there a way to do the same with the soap api? I only see the delete from system call: https://help.exacttarget.com/en/technical_library/web_service_guide/methods/delete/

Based on new requirements, I need to delete the subscriber from the specific list, not update to unsubscribed as shown in the samples.

Thanks, Dennis

1

Thanks for the help, but I solved this one with the below code.

public void RemoveFromList(string email, ExactTargetClient.List list)
    {
        Subscriber sub = new Subscriber();
        sub.EmailAddress = email;
        // Define the SubscriberList and set the status to Deleted
        SubscriberList subList = new SubscriberList();
        subList.ID = list.ID;
        subList.IDSpecified = true;
        subList.Status = SubscriberStatus.Deleted; 
        subList.StatusSpecified = true;

        subList.Action = "update";
        //Relate the SubscriberList defined to the Subscriber
        sub.Lists = new SubscriberList[] { subList };
        _client.Update(sub);
    }

It uses an update call with the subscriberList status set to deleted.

This deletes the subscriber from the list specified and leaves them on any other custom lists and in the AllSubscribers list.

0

I hope the below link is useful for you. There is a mention on how to do it with soap api.

How to Delete a Subscriber

https://code.exacttarget.com/apis-sdks/soap-api/deleting-a-subscriber.html

Sample SOAP Envelope

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
     <Header>
          <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;
               <UsernameToken>
                    <Username>XXXXX</Username>
                    <Password>XXXXX</Password>
               </UsernameToken>
          </Security>
     </Header>
     <Body>
          <DeleteRequest xmlns="http://exacttarget.com/wsdl/partnerAPI"&gt;
               <Objects xsi:type="Subscriber">
                    <PartnerKey xsi:nil="true"/>
                    <ObjectID xsi:nil="true"/>
                    <EmailAddress>example@example.com</EmailAddress>
               </Objects>
          </DeleteRequest>
     </Body>
</Envelope>
  • I think that would delete the subscriber completely. I only need to delete them from individual lists, not the whole system. – Den Aug 26 '15 at 22:21

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.