Retrieve Profile Attributes on the Subscriber Object

By retrieving information from the Subscriber object, you can get a list of values for each profile attribute defined in your account for each subscriber. Once retrieved, you can use this information in your own custom application or system. For example, you could build an application that dynamically retrieves available attributes from your account and uses that information in a triggered email send.

If you don’t have more profile attributes defined in your account, this call retrieves the following information:

1Attribute.Name = "Email Address"
2Attribute.Value = "[subscriber email address]"

Sample .NET Code 

1RetrieveRequest rr = new RetrieveRequest();
2    rr.ObjectType = "Subscriber";
3    rr.Properties = new String[] { "ID" };
4    APIObject[] objs = null;
5    status = partnerAPI.Retrieve(rr, out reqID, out objs);
6    foreach (Subscriber s in objs)
7    {
8        foreach (etapi.Attribute att in s.Attributes)
9        {
10            Console.WriteLine("Name: " + att.Name + " Value: " + att.Value);
11        }
12    }

Sample SOAP Envelope 

1<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">
2    <soapenv:Header>
3        <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
4            <wsse:UsernameToken wsu:Id="UsernameToken-24440876" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
5            <wsse:Username>${#Project#username}</wsse:Username>
6            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">${#Project#pw}</wsse:Password>
7            </wsse:UsernameToken>
8        </wsse:Security>
9    </soapenv:Header>
10    <soapenv:Body>
11        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
12            <RetrieveRequest>
13            <ClientIDs>
14                <ClientID>1234567</ClientID>
15            </ClientIDs>
16            <ObjectType>Subscriber</ObjectType>
17            <Properties>CreatedDate</Properties>
18            <Properties>Client.ID</Properties>
19            <Properties>EmailAddress</Properties>
20            <Properties>SubscriberKey</Properties>
21            <Properties>Status</Properties>
22            <Properties>UnsubscribedDate</Properties>
23            <Properties>EmailTypePreference</Properties>
24            <Properties>ID</Properties>
25            <!--This makes Profile Attributes show in the Results-->
26            <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
27                <Property>SubscriberKey</Property>
28                <SimpleOperator>equals</SimpleOperator>
29                <Value>example@email.com</Value>
30            </Filter>
31            <QueryAllAccounts>false</QueryAllAccounts>
32            </RetrieveRequest>
33        </RetrieveRequestMsg>
34    </soapenv:Body>
35</soapenv:Envelope>