Support

Home Forums Event Espresso Premium API filters

API filters

Posted: April 17, 2015 at 4:02 am


Herman

April 17, 2015 at 4:02 am

Hi,

Using EE3 API.

I trying to find out the correct syntax for a lot of filters. But i’m confused.
I could not find the correct syntax (field names) for doing a query on “Categories”. After a while i found this in the forum.

espresso-api/v1/events/public.pretty_json/?Category.name__like=%25Theater
So, the Categorieshas to be named Category Why?

By creating a filter on Venues. I thought the URL would be:
http://idealeticket.nl/espresso-api/v1/events/public.xml/?Venues.name__like=%25venuename
This URL is not working

After a few trail and error’s i tried
http://idealeticket.nl/espresso-api/v1/events/public.xml/?Venue.name__like=%25venuename
This URL is working.

Q: Is it possible to filter on all fields shown in output of a request?
Q: Where can i find a list with the correct names to use?
Q: How can i filter using the field metadata.event_hashtag


Josh

  • Support Staff

April 20, 2015 at 11:13 am

Hi Herman,

I’ll try to follow up with your questions below:

So, the Categorieshas to be named Category Why?

Where can i find a list with the correct names to use?

How can i filter using the field metadata.event_hashtag?

Please take a look at espresso-json-api/includes/resources/3.1/EspressoAPI_Events_Resource.class.php. Starting on line 45 it lists the related models for things like Categories and Venues. Before that you’ll fine the event specific fields (like Event.event_meta for filtering on Event Meta)

Is it possible to filter on all fields shown in output of a request?

Do you mean chain more fields? If so yes, you can add more by separating them with an &. There’s an example in the documentation that shows how to do a GET request on Events with more than one filter parameter:

https://eventespresso.com/wiki/json-api-add-on/#GETting_with_Query_Parameters

The support post ‘API filters’ 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