2

I am successfully retrieving Subscriber records from the database. The Subscriber.Attributes property contains a list of all the Subscriber Attributes we created in the ExactTarget UI, plus the value for the Attribute given by the Subscriber. For each Attribute I have a Name and a Value, but that's about it.

I am also successfully retrieving ListAttribute records. Some of these records match the Subscriber.Attributes, but there is much more detail, such as DefaultValue and Ordinal and IsHidden, that I need for my application.

I am joining my Subscriber.Attributes to my ListAttributes based on the common field of "Name". This isn't ideal. Name isn't unique in the ListAttributes, so the join is returning multiple copies. It seems to me that there should be a way for me to request Subscribers in such a way that Subscriber.Attributes returns an ObjectID in addition to the Name and Value. Then I could join the two lists on ObjectID instead of Name and most of my issues would disappear. Here is the code I'm using to get Subscribers:

        private List<Subscriber> RetrieveSubscribers()
    {
        var Subscribers = new List<Subscriber>();
        try
        {
            SoapClient client = new SoapClient();
            client.ClientCredentials.UserName.UserName = _username;
            client.ClientCredentials.UserName.Password = _password;

            RetrieveRequest request = new RetrieveRequest();
            request.ObjectType = "Subscriber";
            request.Properties = new String[] { "ID", "SubscriberKey", "EmailTypePreference", "Status" };//, "PartnerProperties"

            SimpleFilterPart filterPart = new SimpleFilterPart { SimpleOperator = SimpleOperators.equals };
            String[] filterValues = { _email };
            filterPart.Property = "EmailAddress";
            filterPart.Value = filterValues;
            request.Filter = filterPart;

            APIObject[] results = null;
            String requestId = null;
            var status = client.Retrieve(request, out requestId, out results);

            if (status.Equals("OK"))
            {
                foreach (Subscriber s in results)
                {
                    Subscribers.Add(s);
                }
            }
            else
            {
                ErrorMessage.Text += "Error Retrieving Subscriber: " + status;
                ErrorMessage.Text += "<br />";
            }
        }
        catch (Exception exception)
        {
            if (exception.InnerException != null && !string.IsNullOrWhiteSpace(exception.InnerException.Message))
            {
                ErrorMessage.Text += exception.InnerException.Message;
            }
            else
            {
                ErrorMessage.Text += exception.Message;
            }
            ErrorMessage.Text += "<br />";
        }
        return Subscribers;
    }
2
  • What information are you hoping to get by looking at the ListAttribute object?
    – Mac
    Commented Jan 7, 2015 at 18:45
  • Name, DefaultValue, Ordinal and IsHidden are all things I need that I am getting back from ListAttribute. From Subcriber Profile Attributes I am getting Name and Value. I am joining the two lists based on Name, but since Name isn't unique in ListAttributes, the join is imperfect. I need some sort of ID that both have in common. Commented Jan 8, 2015 at 19:41

1 Answer 1

1

Email from ExactTarget's [email protected]:

<DefinitionRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <DescribeRequests>
            <ClientIDs>
               <ID>_____________</ID>
            </ClientIDs>
            <ObjectDefinitionRequest>
               <ObjectType>Subscriber</ObjectType>
            </ObjectDefinitionRequest>
         </DescribeRequests>
      </DefinitionRequestMsg>

https://help.exacttarget.com/en/technical_library/web_service_guide/technical_articles/describing_a_subscriber/

-----------End Email-------------

This looks like it will work for me. The Describe method retrieves all the meta-data about all my Subscriber's custom profile attributes, without having to pull it directly from ListAttribute.

You must log in to answer this question.

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