Home › Forums › Calendar Products › Events Calendar PRO › How to return/filter events via rest api
- This topic has 7 replies, 4 voices, and was last updated 8 years, 8 months ago by
Courtney.
-
AuthorPosts
-
August 19, 2017 at 9:10 pm #1337859
Joel
ParticipantHello,
I’m trying to filter events via the Events Calendar REST API and have not found any success. I am able to filter events with queires that contain single IDs but not multiple IDs. In its current version, is it possible to filter results from multiple IDs of anything – posts, categories, organizer, etc?
Does work with single
/wp-json/tribe/events/v1/events?categories=2Do not work with multiple:
/wp-json/tribe/events/v1/events/4,6
/wp-json/tribe/events/v1/events?organizer=7,14
/wp-json/tribe/events/v1/events/?filter[organizer]=7,14Thanks,
JoelAugust 21, 2017 at 9:29 pm #1338397Cliff
MemberHi, Joel. Thanks for your detailed request.
You can use /wp-json/tribe/events/v1/doc for self-documentation.
It looks like you’ll need to pass an array of category slugs or IDs to “categories”
Please give that a try and let me know how it goes for you.
August 24, 2017 at 8:42 pm #1340127Joel
ParticipantThanks for your direction Cliff. I was able to filter/return events by passing an array of categories:
/wp-json/tribe/events/v1/events?categories[]=5&categories[]=3From the docs, it doesn’t look like you are able to pass an array of organizers. I’m able to filter events via a single organizer:
/wp-json/tribe/events/v1/events?organizer=7Is extending this functionality to accept an array of organizers set for a future release?
Thanks!
August 25, 2017 at 4:33 pm #1340562Cliff
MemberIt wasn’t on our internal to-do list as far as I could tell so I filed a feature request internally to add “array” querying for both Organizers and Venues.
Hopefully they’ll get around to it eventually, but I can’t promise if/when that might be.
Please let me know if you have any follow-up questions on this topic at this time.
August 26, 2017 at 6:24 pm #1340856Joel
ParticipantThanks!
August 28, 2017 at 8:35 pm #1341556Cliff
MemberYou’re welcome. And thanks to you for your detailed reports and requests!
September 25, 2017 at 11:21 am #1354412Courtney
MemberHey there
Just posting a quick update that we’ve just launched The Events Calendar – Full REST Support. You can read the release notes at https://theeventscalendar.com/release-events-calendar-full-rest-support/.
We also published a helpful guide: Introduction to The Events Calendar REST API https://theeventscalendar.com/knowledgebase/introduction-events-calendar-rest-api/ .
We’re excited to provide this functionality for you.
Thanks
Courtney 🙂 -
AuthorPosts
- The topic ‘How to return/filter events via rest api’ is closed to new replies.
