wp-json return data by date

Home Forums Calendar Products Events Calendar PRO wp-json return data by date

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1354088
    Bridgett Raffenberg
    Participant

    this 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
    #1357149
    Cliff
    Member

    Hi, 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-24 does actually work for me though. Are you saying it doesn’t work for you?

    #1357431
    Bridgett Raffenberg
    Participant

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

    #1358005
    Cliff
    Member

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

    #1409066
    Courtney
    Member

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

    #1422482
    Support Droid
    Keymaster

    Hey 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘wp-json return data by date’ is closed to new replies.