Why do no records appear when I change pagingtoken date to a later date? | Community
Skip to main content
November 29, 2016
Solved

Why do no records appear when I change pagingtoken date to a later date?

  • November 29, 2016
  • 1 reply
  • 2945 views

Not sure if it's something I'm doing wrong (usually it is).

The call I'm making in PHP is this:

$ch = curl_init("https://273-EQL-130.mktorest.com/rest/v1/activities.json?activityTypeIds=1&leadIds=1166102&nextPageToken=" . $pagingToken . "&access_token=" . $accessToken);

Let's take it as read that the access token is working.

I'm getting the paging token like this:

$ch = curl_init("https://273-EQL-130.mktorest.com/rest/v1/activities/pagingtoken.json?sinceDatetime=2016-11-01&access_token=" . $accessToken);

When I use November 1st as the sinceDateTime value, it works great: I get back 300 records (the max).

When I use October 1st as the sinceDateTime value, I get a similar result (300 records).

$ch = curl_init("https://273-EQL-130.mktorest.com/rest/v1/activities/pagingtoken.json?sinceDatetime=2016-10-01&access_token=" . $accessToken);

But when I use September 1st as the sinceDateTime value, I get no records returned, but "moreResult" is true:

This page says

The first is a paging token which represents a date.  These are used to retrieve activities, data value changes, and deleted leads which occurred after the date represented by the paging token.

Should it not be the case that if I go to an earlier date, everything after that date would be subsumed under the description "which occurred after the date represented by the paging token"? And if that's true, should I not be getting results in my call with the September paging token, just like I do for October and November? Our Marketo installation was active as of July, so it's not that I'm going back before we had records...

Any help is much appreciated - thanks in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Imagine -- I'm not saying this is the exact implementation, as it's a black box fo us, but food for thought  -- the pages are based on all activity types in the log, regardless of the applied filter. 

1 reply

SanfordWhiteman
New Participant
November 29, 2016

Sometimes, moreResult returns true even with no data in the current payload.  It's the way the cursor is implemented (maybe some kind of global checkpointing).

November 29, 2016

Thanks for the quick response! My question would then be: Why would there be no payload if the calls for later dates DO have a payload and all else is equal?

Edit: I should add the call for the September date just in case there is something wrong with the syntax:

$ch = curl_init("https://273-EQL-130.mktorest.com/rest/v1/activities/pagingtoken.json?sinceDatetime=2016-09-01&useBlockbuster=true&access_token=" . $accessToken);

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
November 29, 2016

Imagine -- I'm not saying this is the exact implementation, as it's a black box fo us, but food for thought  -- the pages are based on all activity types in the log, regardless of the applied filter.