0

I'm trying to get all OpenEvent objects created in the past 24 hours. When using the 'between' filter on 'CreatedDate' with the values '2020-12-13T00:00:00' and '2020-12-14T00:00:00', I get objects that were created more than 24 hours ago.

      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>OpenEvent</ObjectType>
            <Properties>BatchID</Properties>
            <Properties>CreatedDate</Properties>
            <Properties>EventDate</Properties>
            <Properties>EventType</Properties>
            <Properties>ID</Properties>
            <Properties>ModifiedDate</Properties>
            <Properties>ObjectID</Properties>
            <Properties>PartnerKey</Properties>
            <Properties>SendID</Properties>
            <Properties>SubscriberKey</Properties>
            <Properties>TriggeredSendDefinitionObjectID</Properties>
            <Filter xsi:type="SimpleFilterPart">
               <Property>CreatedDate</Property>
               <SimpleOperator>between</SimpleOperator>
               <DateValue>2020-12-13T00:00:00</DateValue>
               <DateValue>2020-12-14T00:00:00</DateValue>
            </Filter>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>

Response Sample:

         <Results xsi:type="OpenEvent">
            <PartnerKey/>
            <CreatedDate>2020-12-12T18:03:32</CreatedDate>
            <ModifiedDate>2020-12-12T18:03:32</ModifiedDate>
            <ID>35219288</ID>
            <ObjectID>35219288</ObjectID>
            <SendID>21961</SendID>
            <SubscriberKey>0035G00001arGmFQAU</SubscriberKey>
            <EventDate>2020-12-12T18:03:32</EventDate>
            <EventType>Open</EventType>
            <TriggeredSendDefinitionObjectID>598c8608-fb38-eb11-a2ee-48df37342621</TriggeredSendDefinitionObjectID>
            <BatchID>23</BatchID>
         </Results>
         <Results xsi:type="OpenEvent">
            <PartnerKey/>
            <CreatedDate>2020-12-12T18:03:34</CreatedDate>
            <ModifiedDate>2020-12-12T18:03:34</ModifiedDate>
            <ID>35219330</ID>
            <ObjectID>35219330</ObjectID>
            <SendID>21961</SendID>
            <SubscriberKey>0035G00001arGmFQAU</SubscriberKey>
            <EventDate>2020-12-12T18:03:34</EventDate>
            <EventType>Open</EventType>
            <TriggeredSendDefinitionObjectID>598c8608-fb38-eb11-a2ee-48df37342621</TriggeredSendDefinitionObjectID>
            <BatchID>23</BatchID>
         </Results>

Is there a fix for this? Or a better way to do it?

1 Answer 1

0

Found the issue. The server converts date input from Central time to UTC time, so I had to add 6 hours to get the correct date. The filter looks like this now

<Filter xsi:type="SimpleFilterPart">
     <Property>CreatedDate</Property>
     <SimpleOperator>between</SimpleOperator>
     <DateValue>2020-12-13T06:00:00</DateValue>
     <DateValue>2020-12-14T06:00:00</DateValue>
 </Filter>

You must log in to answer this question.

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