1

I have the list in my business unit. There are lots of subscribers. I need to be able to change the opt in opt out preferences for any subscriber from API call.

I found the next article http://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/managing_subscribers_on_lists/

And here is my code... When I execute it, status is OK, but when I refresh the exacttarget page / list with subscribers, I don't see any changes. How to manage Opt In / Opt Out preferences for any particular list and subscriber?

var sub = new Subscriber
{
    SubscriberKey = "10103-KZ-P-Cust",
    Client = new ClientID
    {
        ID = 11011214,
        IDSpecified = true
    }
};

var benList = new SubscriberList
{
    ID = 6851919,
    IDSpecified = true,
    Status = SubscriberStatus.Unsubscribed,
    Action = "Update"
};

sub.Lists = new[] { benList };

var soap = new SoapClient();

soap.ClientCredentials.UserName.UserName = _login;
soap.ClientCredentials.UserName.Password = _password;

APIObject[] results;
string requestID;
string status;

UpdateResult[] updateResults = 
    soap.Update(new UpdateOptions(), new APIObject[] { sub }, out requestID, out status);
10
  • When you are refreshing the page, is it in the business unit you are trying to change, or in the top level all subscribers list? Jan 3, 2014 at 13:40
  • That's inside my business unit (child), not in the default (parent) one. Jan 3, 2014 at 13:59
  • Has the user you are passing in for credentials been given access to that specific business unit, as well? Nothing immediately jumps out in code, but the c# isn't my normal language, so I'm going off examples. Jan 3, 2014 at 14:25
  • Yes, that user was created for API usage. And I don't get any errors. status is OK, UpdateResult also says that Subscriber's List property exists. Jan 3, 2014 at 16:15
  • I'll play around and try to reproduce this. I suspect that your API user doesn't have access to the business unit though. Are you able to do any other api calls into business units? Jan 3, 2014 at 16:24

1 Answer 1

0

Online documentation is incomplete.

We need put StatusSpecified = true; in order to send changed status to ExactTarget.

Full source code:

var benList = new SubscriberList
{
    ID = 6851919,
    IDSpecified = true,
    Status = SubscriberStatus.Unsubscribed,
    StatusSpecified = true, // <==== THIS ONE WAS MISSING FOR PROPER WORK
    Action = "Update"
};

This property was not listed neither here http://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/managing_subscribers_on_lists/ nor here http://help.exacttarget.com/en/technical_library/web_service_guide/objects/subscriberlist/

1
  • Be sure to mark this as the answer. Just click the checkmark. Jan 19, 2014 at 2:38

You must log in to answer this question.

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