Support

Home Forums Event Espresso Premium API call is only fetching 50 rows how do i set it for more?

API call is only fetching 50 rows how do i set it for more?

Posted: January 17, 2023 at 7:15 pm


SONIC BLOOM

January 17, 2023 at 7:15 pm

I cannot get the api to populate past 50 rows when calling API into google sheets


Tony

  • Support Staff

January 20, 2023 at 7:47 am

Hi there,

The default ‘limit’ value is set at 50, thee is a filter you can use to increase that:

FHEE__EED_Core_Rest_Api__get_default_query_limit

However, be careful as you will start to run into timeouts as you increase the value higher.

You can also set the limit within the query itself, for example:

/wp-json/ee/v4.8.36/registrations?limit=0,100

The first value is the offset, the second is the limit, so 0,100 returns rows 1-100, and 50,100 returns rows 51-100


SONIC BLOOM

January 20, 2023 at 8:00 am

awesome, thank you…. – i am curious if there is a way to automate the requests and pull only new data each API call? – this would be fine, as we can manually set the new entries to pull, but was hoping to have it fully automated to append new entries as tickets become registered


Tony

  • Support Staff

January 20, 2023 at 8:06 am

i am curious if there is a way to automate the requests and pull only new data each API call?

I’m not sure I follow, how would you define ‘new’ data?

If I send a request to /wp-json/ee/v4.8.36/registrations/

And then you sent a request to /wp-json/ee/v4.8.36/registrations/

How does EE know the different between the two to define ‘new’ registrations?

REST API’s are stateless, which basically means that rather than relying on the server to remember the previous requests, REST requires each request to contain all of the info needed for the server to understand that request. So you would need ‘something’ within the request to define what is ‘new’ and I’m sure how you would do it, you could possibly use REG_date and do requests between a specific time but even then you would still end up with an overlap with multiple requests.


SONIC BLOOM

January 23, 2023 at 9:17 am

thank you

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso