3

I have a working retrieve request to the SOAP API from .NET (using code generated from wsdl.exe) which is filtering a DataExtensionObject for a specific data extension and I am getting the correct properties from it but I also need not just the properties but the CreatedDate value of the "row" itself.

I am accessing the CreatedDate property of the DataExtensionObject but in my testing I am only getting the value of "1/1/001 12:00:00 AM" as the CreatedDate which is obviously not right. I have seen this answer but the recommendation of just accessing the CreatedDate property of the APIObject is not giving the correct value.

I have not been able to find any properties or options on the RetrieveRequest that specify it is to return the CreatedDate value. Have I missed something or is this not possible?

Sample SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
        <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <u:Timestamp u:Id="_0">
                <u:Created>2014-01-21T02:39:19.607Z</u:Created>
                <u:Expires>2014-01-21T02:44:19.607Z</u:Expires>
            </u:Timestamp>
            <o:UsernameToken u:Id="uuid-00000000-0000-0000-0000-000000000000-0">
                <o:Username>XXXXXXXXXXXXXXXX</o:Username>
                <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXXXXXXXXXXXXXXXXX</o:Password>
            </o:UsernameToken>
        </o:Security>
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <RetrieveRequest>
                <ObjectType>DataExtensionObject[Customer]</ObjectType>
                <Properties>firstname</Properties>
                <Properties>status</Properties>
                <Properties>lastname</Properties>
                <Properties>billing_address_2</Properties>
                <Properties>prefix</Properties>
                <Properties>gender</Properties>
                <Properties>middlename</Properties>
                <Properties>reason_description</Properties>
                <Properties>group_id</Properties>
                <Properties>email</Properties>
                <Filter xsi:type="SimpleFilterPart">
                    <Property>email</Property>
                    <SimpleOperator>equals</SimpleOperator>
                    <Value>XXXXXXXXXXXX@XXXXXXXXXXXXXX.com</Value>
                </Filter>
            </RetrieveRequest>
        </RetrieveRequestMsg>
    </s:Body>
</s:Envelope>

Sample SOAP Response:

<?xml version="1.0" encoding="utf-8"?>
<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:00000000-0000-0000-0000-000000000000</wsa:MessageID>
        <wsa:RelatesTo>urn:uuid:00000000-0000-0000-0000-000000000000</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
        <wsse:Security>
            <wsu:Timestamp wsu:Id="Timestamp-66e01ee8-5374-4de4-bbde-28e180bf8d70">
                <wsu:Created>2014-01-21T02:39:20Z</wsu:Created>
                <wsu:Expires>2014-01-21T02:44:20Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <OverallStatus>OK</OverallStatus>
            <RequestID>00000000-0000-0000-0000-000000000000</RequestID>
            <Results xsi:type="DataExtensionObject">
                <PartnerKey xsi:nil="true" />
                <ObjectID xsi:nil="true" />
                <Type>DataExtensionObject</Type>
                <Properties>
                    <Property>
                        <Name>firstname</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>status</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>lastname</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>billing_address_2</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>prefix</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>middlename</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>reason_description</Name>
                        <Value />
                    </Property>
                    <Property>
                        <Name>group_id</Name>
                        <Value>1</Value>
                    </Property>
                    <Property>
                        <Name>email</Name>
                        <Value>XXXXXXXXXXXX@XXXXXXXXXXXXXX.com</Value>
                    </Property>
                </Properties>
            </Results>
        </RetrieveResponseMsg>
    </soap:Body>
</soap:Envelope>
  • Welcome to SFSE! – Kelly J Andrews Jan 20 '14 at 17:08
  • Do you have a SOAP envelope you are passing in that you can update your question with? – Kelly J Andrews Jan 20 '14 at 23:09
1

By default a DataExtensionObject (a row in a data extension) does not store information for when that row was created or when it was last updated. If this detail is needed for a data extension then a field for that value will need to be added. The field can be setup to use the current date as the default value so it could automatically be populated with the date that record was created that way.

The CreatedDate property is inherited from APIObject as it is the parent object for almost all objects you will interact with in the ExactTarget SOAP API but for DataExtensionObject it is not used.

| improve this answer | |
  • 1
    Is the documentation for this automatically generated then? Makes it difficult to know what isn't used when it's in the docs. – Kelly J Andrews Jan 21 '14 at 17:52
  • Well, it is an answer and likely correct, although I agree with Kelly that I am not too happy about it. The docs call out that the CreatedDate is available for a DataExtensionObject ( help.exacttarget.com/en/technical_library/web_service_guide/… )and it would be great if they would actually only list what is available so I don't tell clients incorrect answers. – Joe Kuemerle Jan 21 '14 at 18:24
  • Yes, that part of the documentation is automatically generated off the WSDL so does not provide a complete picture of what can be done. – Mac Jan 21 '14 at 18:56

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.