2

I'm using the C# Fuel SDK to fetch BounceEvents created on a given date. On an initial request, I receive back a GetReturn with a Status of true and an expected batch of APIObjects in Results. However, if I repeat the request a second time with the same parameters, Results is empty:

var date = new DateTime(2014, 10, 01);

var filter = new ComplexFilterPart {
    LeftOperand = new SimpleFilterPart {
        Property = "EventDate",
        SimpleOperator = SimpleOperators.greaterThanOrEqual,
        DateValue = new[]{date}
    },
    LogicalOperator = LogicalOperators.AND,
    RightOperand = new SimpleFilterPart {
        Property = "EventDate",
        SimpleOperator = SimpleOperators.lessThan,
        DateValue = new[]{date.AddDays(1)}
    }
};

var etRequest = new ET_BounceEvent{
    AuthStub = new ET_Client(new NameValueCollection {{"clientId", "XXX"}, {"clientSecret", "XXX"}}),
    SearchFilter = filter
};

etRequest.Get().Dump();

This is potentially related to pagination, but it seems odd that that would apply since I'm creating a new ET_BounceEvent client between requests. (And if it is pagination-related, what parameter do I need to pass in to reset to the first page of results?)

This problem persists even if I remove the filter.

(This seems related to ET_ClickEvent Get() does not return results consistently)

1

The GetSinceLastBatch property on tracking events defaults to True so after you retrieve the records, it keeps track and only returns new records when a subsequent call is made with the same criteria.

To disable it, set the GetSinceLastBatch property on ET_BounceEvent to false.

Example:

var etRequest = new ET_BounceEvent{
    AuthStub = new ET_Client(new NameValueCollection {{"clientId", "XXX"}, {"clientSecret", "XXX"}}),
    SearchFilter = filter,
    GetSinceLastBatch = false };
| improve this answer | |

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.