Home › Forums › Calendar Products › Events Calendar PRO › wp-json return data by date
- This topic has 6 replies, 3 voices, and was last updated 8 years, 3 months ago by
Bridgett Raffenberg.
-
AuthorPosts
-
September 24, 2017 at 6:21 pm #1354088
Bridgett Raffenberg
Participantthis works: /wp-json/tribe/events/v1/events?categories[]=arts.
However, I would like to get events by date(s), but I keep getting all events not just for specific date or date range. How would I get events for just 1 date or for a weekend (Fri -Sun). I’ve tried iterations such as:
/wp-json/tribe/events/v1/events?date=2017-09-24
/wp-json/tribe/events/v1/events?date[]=2017-09-24
/wp-json/tribe/events/v1/events?dates=2017-09-24
/wp-json/tribe/events/v1/events?today
/wp-json/tribe/events/v1/events?date=today/wp-json/tribe/events/v1/events?start_date=2017-09-22&end_date=2017-09-24
Is it possible to return JSON by date?
Also, I see this is v1. Online I see there is a v2 which is more secure? Is v2 implemented with ECP?
The use case is to send JSON information to an Alexa skill.
-
This topic was modified 8 years, 7 months ago by
Bridgett Raffenberg. Reason: update text in request
September 29, 2017 at 4:25 pm #1357149Cliff
MemberHi, Bridgett. Sorry for the delayed reply.
The Events Calendar’s v1 uses WordPress’ built-in API, which didn’t get included into WordPress core until v2 of the API. So don’t worry about that…
You can go to /wp-json/tribe/events/v1/doc, and you can also reference https://theeventscalendar.com/knowledgebase/introduction-events-calendar-rest-api/
/wp-json/tribe/events/v1/events?start_date=2017-09-22&end_date=2017-09-24does actually work for me though. Are you saying it doesn’t work for you?September 30, 2017 at 7:18 pm #1357431Bridgett Raffenberg
ParticipantThe response does return structured data, but it does not return what is expected. I would like to return all events for a specific day. If I follow the documentation and use per_page = x, this overrides end date so will fetch more events than on on the specific day.
Also, it appears the REST API goes after the UTC time and not the local time as I get events locally at 10:00pm but will show on next day since +4hrs is 2:00am next day.
When I click on the “day” view on the EC calendar, the page returns all of the events for the day (on the webpage).
I would like to return the same data with the wp-json response but have not determined the path to do this. Have tried
/wp-json/tribe/events/v1/events/?per_page=100&start_date=2017-09-30″;but I get 100 events whether or not they are on the events are on 2017-09-30.
October 2, 2017 at 3:20 pm #1358005Cliff
MemberBridgett, thanks for your detailed response. I’ve confirmed start_date, end_date, and per_page do not work as expected.
I’ve reported this to our developers.
I’ll mark this ticket as Pending Fix, which means this thread should receive a reply once the applicable fix has been released. I cannot guarantee when it will be fixed as it’s in the development team’s hands now. They need to assign it, code it, test it, and schedule it for release.
I apologize for this issue and appreciate your understanding and patience.
December 19, 2017 at 12:13 pm #1409066Courtney
MemberHey there Bridgett
We’ve just released an update that should fix this bug. You can read more about it at http://m.tri.be/19tp. Please update your plugins and let us know if you are still experiencing this or if we can close out this ticket.
Note: We suggest testing updates on a staging server (https://theeventscalendar.com/knowledgebase/creating-using-wordpress-staging-site/).
Thanks
Courtney 🙂January 10, 2018 at 8:37 am #1422482Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
This topic was modified 8 years, 7 months ago by
-
AuthorPosts
- The topic ‘wp-json return data by date’ is closed to new replies.
