Support

Home Forums Event Espresso Premium Is there a way to do a JSON query with pagination?

Is there a way to do a JSON query with pagination?

Posted: May 6, 2014 at 12:55 am

Viewing 0 reply threads


dm37ee

May 6, 2014 at 12:55 am

I don’t want to have to pull down all events from now till forever every time and then limit it to the ones I want to do pagination. I’d rather only pull down the ones needed for that request and if they click for “more”, I’ll pull down the next batch. Is this possible?

Something like this:

(pesudo code)

https://192.168.1.101/espresso-api/v1/events/hr871mwudw?start=17&total=20


Michael Nelson

  • Support Staff

May 13, 2014 at 10:09 am

It sounds like you’re wanting to use an offset, which currently isn’t supported by the API. But we suggest some workarounds in the “Query Limits” section of the documentat: https://eventespresso.com/wiki/api-addon/#Query_Limits. This is because we’re needing to do a bunch of processing on the data after retrieiving it from the database, which has made it difficult to do offsets efficiently.
The main workaround being to use limit and a condition on the ID (because results are always ordered by their ID at the moment). Eg, to accomplish your psuedo code:

mysite.com/espresso-api/v1/events/{sessionkey}?id__gt=17&limit=20

Viewing 0 reply threads

The support post ‘Is there a way to do a JSON query with pagination?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso