How to return/filter events via rest api

Home Forums Calendar Products Events Calendar PRO How to return/filter events via rest api

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1337859
    Joel
    Participant

    Hello,

    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=2

    Do 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,14

    Thanks,
    Joel

    #1338397
    Cliff
    Member

    Hi, 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.

    #1340127
    Joel
    Participant

    Thanks 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[]=3

    From 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=7

    Is extending this functionality to accept an array of organizers set for a future release?

    Thanks!

    #1340562
    Cliff
    Member

    It 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.

    #1340856
    Joel
    Participant

    Thanks!

    #1341556
    Cliff
    Member

    You’re welcome. And thanks to you for your detailed reports and requests!

    #1354412
    Courtney
    Member

    Hey 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 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to return/filter events via rest api’ is closed to new replies.