Find your content:

Search form

You are here

How Can I Create an HTML Page with the Subscriber Attributes in the Correct Order?

 
Share

I am retrieving the Subscriber from the API.

The Marketing Cloud advertises an Order field in the Profile Management section, that allows attributes to be ordered. Also, there is a "Hidden" checkbox in the properties dialog box for an attribute to be hidden from the subscriber.

Issue: Unfortunately, the Order integer, and the Hidden boolean are not provided in the response from the API. There seems to be some missing data in the response from the API, because it is not a reflection of the Profile Management section in the Marketing Cloud.

Use-case: I'm building a custom preference center that is integrated with the ExactTarget API. The preference center is using a content engine to dynamically write the HTML using the data retrieved via the API Call. Because I am relying on the ExactTarget API for the data, I'm hoping the API would have the ability to reference the Order and Hidden fields in the response, so I can iterate over these objects and print their values through my PHP engine.

--

Is it possible to add these extra values into the Attributes of the Soap Response?

--

Proposed Solution:

[Results] => Array
    (
        [PartnerKey] => 
        [ID] => 0000000000
        [ObjectID] => 
        [EmailAddress] => someone@mail.com
        [Attributes] => Array
            (
                [0] => Array
                    (
                        [Name] => Email Address
                        [Value] => someone@mail.com
                        [Order] => 4
                        [Hidden] => FALSE
                    )

                [1] => Array
                    (
                        [Name] => First Name
                        [Value] => John
                        [Order] => 1
                        [Hidden] => FALSE
                    )

                [2] => Array
                    (
                        [Name] => Interest Level
                        [Value] => 75%
                        [Order] => 3
                        [Hidden] => TRUE
                    )

                [3] => Array
                    (
                        [Name] => Last Name
                        [Value] => Smith
                        [Order] => 2
                        [Hidden] => FALSE
                    )

            )

        [SubscriberKey] => someone@mail.com
        [Status] => Active
    )

Attribution to: Axiom

Possible Suggestion/Solution #1

The ListAttribute object returns the Ordinal property for this -

Sample Request

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Header>  
        <fueloauth xmlns="http://exacttarget.com">your api key</fueloauth>
    </Header> 
       <Body>
          <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
             <RetrieveRequest>
                <ObjectType>ListAttribute</ObjectType> 
                <Properties>Name</Properties> 
                <Properties>Ordinal</Properties>    
             </RetrieveRequest>
          </RetrieveRequestMsg>
       </Body>
</Envelope>

Sample Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soap:Header>
      <wsa:Action>RetrieveResponse</wsa:Action>
      <wsa:MessageID>urn:uuid:4052ca74-1c5b-4d89-bfff-daecb764484f</wsa:MessageID>
      <wsa:RelatesTo>urn:uuid:589c0c8c-5309-40b9-bf1e-ea58ac8274c2</wsa:RelatesTo>
      <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsse:Security>
         <wsu:Timestamp wsu:Id="Timestamp-351a200d-f58e-474c-b3e5-333c43f6a826">
            <wsu:Created>2014-04-25T10:22:30Z</wsu:Created>
            <wsu:Expires>2014-04-25T10:27:30Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <OverallStatus>OK</OverallStatus>
         <RequestID>e31df1ab-2c43-4425-bf26-450d7ceb31b0</RequestID>
         <Results xsi:type="ListAttribute">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <Name>_ModifiedDate</Name>
            <Ordinal>19</Ordinal>
         </Results>
         <Results xsi:type="ListAttribute">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <Name>SubscriberKey</Name>
            <Ordinal>1</Ordinal>
         </Results>
         <Results xsi:type="ListAttribute">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <Name>FullName</Name>
            <Ordinal>2</Ordinal>
         </Results>
      <!-- results continue -->
      </RetrieveResponseMsg>
   </soap:Body>
</soap:Envelope>

You should be able to use this in building out the profile center.

Edit Link to ListAttribute docs


Attribution to: Kelly J Andrews
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33708

My Block Status

My Block Content