Support

Home Forums Event Espresso Premium Retrieve Registrations through API based on date.

Retrieve Registrations through API based on date.

Posted: September 2, 2014 at 12:59 pm


Anthony Santarosa

September 2, 2014 at 12:59 pm

I simply want to pull registrations based on a date inquiry on a daily basis in order to move the data to another location.

In my test setup I have 8 current registrations. Testing the API by using:

GET mysite.com/espresso-api/v1/registrations/{session_key}?&Event.id=1

I successfully retrieve all the registrations.

However if I attempt to retrieve any based on the date_of_registration none are retrieved.

Is there a simple way to do this or do I have to always download all and then sort through by date range?

I would simply like to get all registrations that occurred on 2014-09-01. Then tomorrow, I would increment my date counter and retrieve all registrations that occurred on 2014-09-02.

Thanks,
anthony


Dean

September 3, 2014 at 1:39 am

Hi,

I think the best way to do this is like so:

espresso-api/v1/registrations/SESSIONKEY?date_of_registration>2014-09-02%2000:00:00&date_of_registration<2014-09-02%2023:59:59

So its just searching for all registrations from midnight to just before the next midnight on a given day.


Anthony Santarosa

September 4, 2014 at 10:27 am

I performed the following:

espresso-api/v1/registrations/SESSIONKEY?date_of_registration>2014-08-21%2000:00:00&date_of_registration<2014-08-21%2023:59:59

And I still retrieved results outside of that range.


Dean

September 5, 2014 at 2:37 am

Hi Anthony,

I ran some fairly exhaustive tests on this today and I am also seeing this as an issue. I’m going to raise a ticket for the API developer to look at and see if it’s a bug or whether something else needs to be done to retrieve registrations by date.


Anthony Santarosa

September 9, 2014 at 5:14 am

Any update on this issue?


Dean

September 9, 2014 at 5:22 am

Hi Anthony,

I was looking at this one today. It’s definitely a bug. The developer has put forward a fix, but I’m awaiting some further feedback from him to double check some things.


Anthony Santarosa

September 12, 2014 at 8:20 am

Is the update any closer to release?


Sidney Harrell

September 14, 2014 at 6:44 pm

Looks like this was released in the 2.1.3 update of the JSON api add-on. Is that the version that you are running?


Anthony Santarosa

September 16, 2014 at 3:43 pm

Yes, I have the latest version of the API installed. The above query still returns all registrants.


Dean

September 17, 2014 at 12:40 am

Hi,

It might be my because my original query above was wrong (sorry about that).

You can’t use > and <. Instead use a query such as: espresso-api/v1/registrations/SESSIONKEY?date_of_registration__gt=2014-08-21%2000:00:00&date_of_registration__lt=2014-08-21%2023:59:59 __lt : less than __gt : greater than __lte : less than or equal to __gte : greater than or equal to


Anthony Santarosa

September 17, 2014 at 6:27 am

Thanks, I saw that in the docs, but I thought you may have updated the API because of the code you posted.

Everything works now. Thanks, this will be a big help.

Anthony

The support post ‘Retrieve Registrations through API based on date.’ 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