Posted: 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, |
|
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. |
|
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. |
|
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. |
|
Any update on this issue? |
|
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. |
|
Is the update any closer to release? |
|
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? |
|
Yes, I have the latest version of the API installed. The above query still returns all registrants. |
|
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 |
|
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.