API: pagination issue - always getting "has_more" even when no items returned

I've just (finally!) updated an app I wrote to "re-link" Evernote imports to use the updated pagination API, but am hitting a problem in the latest release (1.6.7). I can retrieve all of the results, but as I increment the page parameter, has_more never seems to vanish, so I keep looping and making requests for more data, getting nothing, but not knowing when to stop. Does anyone else have this issue?

For example, from the last few iterations of retrieving all notes (token removed for clarify), if I dump the URL, the items in the response, and the number of notes retrieved I get:

dict_keys(['items', 'has_more'])
number of items: 7700
dict_keys(['items', 'has_more'])
number of items: 7722
dict_keys(['items', 'has_more'])
number of items: 7722
dict_keys(['items', 'has_more'])

any ideas? @laurent ?


I have tested it with 1.6.5 and 1.6.7 and it works and it works as designed.
The has_more is an boolen field, therefore it is always present therefore it is always present!

1 Like

Ahh, OK, the docs say:

Eventually you will get some results that do not contain an "has_more" paramater, at which point you will have retrieved all the results

but if it is a boolean that is always present, I'll use that instead - thanks!

Confirmed, if I update my code to check the value, not presence, of that field, everything works as expected.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.