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);
  • 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? – Kelly J Andrews Jan 3 '14 at 13:40
  • That's inside my business unit (child), not in the default (parent) one. – Akim Khalilov Jan 3 '14 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. – Kelly J Andrews Jan 3 '14 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. – Akim Khalilov Jan 3 '14 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? – Kelly J Andrews Jan 3 '14 at 16:24
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/

  • Be sure to mark this as the answer. Just click the checkmark. – Kelly J Andrews Jan 19 '14 at 2:38

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.