Problem with REST API

Home Forums Calendar Products Events Calendar PRO Problem with REST API

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1358465
    Gilles
    Participant

    Hello,

    I am experiencing a problem with the REST API. Everything was working until recently. I am running the following GET request:

    GET https://wednesdaynighthop.com/wnhapi/tribe/events/v1/events?start_date=2017-10-04&per_page=10

    and it works and returns multiple events, including this one:

    {
      "events": [
        {
          "id": 11971,
          ...
          "status": "publish",
          ...
          "start_date": "2017-10-04 19:15:00",
          ...
          "end_date": "2017-10-04 20:15:00",
          ...
      ]
    }

    Now I try to run the following GET request:

    GET https://wednesdaynighthop.com/wnhapi/tribe/events/v1/events?start_date=2017-10-04&end_date=2017-10-05&per_page=10

    and I get this:

    {
      "code": "event-archive-page-not-found",
      "message": "The requested event archive page does not exist",
      "data": {
        "status": 404
      }
    }

    when it used to return events before.

    Is there something I should change in the way I am making the request. As I said, this used to work since I started developing my app back in May.

    Thank you for any advice you may have!

    #1358475
    Gilles
    Participant

    Hello, shouldn’t the documentation for end_date say ‘Events should end before the specified date’?

    start_date
    string
    (query)	
    Events should start after the specified date
    
    end_date
    string
    (query)	
    Events should start before the specified date
    #1358479
    Gilles
    Participant

    Are the dates supposed to be converted to UTC before being used in the query? because I see the following from wp-content/plugins/the-events-calendar/src/Tribe/REST/V1/Endpoints/Archive_Event.php:

    [03-Oct-2017 17:54:02 UTC] Array
    (
        [page] => 1
        [per_page] => 10
        [start_date] => 2017-10-03 17:00:00
        [end_date] => 2017-10-04 17:00:00
        [paged] => 1
        [posts_per_page] => 10
        [meta_query] => Array
            (
            )
    
        [tax_query] => Array
            (
            )
    
        [post_status] => publish
    )
    • This reply was modified 6 years, 7 months ago by Gilles.
    • This reply was modified 6 years, 7 months ago by Gilles.
    #1359246
    Cliff
    Member

    Hi, Gilles.

    We recently discovered 1) bugs and 2) too vague of documentation, both of which I logged with our developers this week.

    I’m sorry you’ve been affected by this, but I don’t want to advise you one way or the other because I’m unsure how any bug fixes would affect things.

    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.

    #1409067
    Courtney
    Member

    Hey there Gilles

    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 🙂

    #1411381
    Gilles
    Participant

    Thank you for letting me know. I will try it out. Is there documentation for the new tribe_events_rest_use_inclusive_start_end_dates filter?

    #1411620
    Cliff
    Member

    We always try to document each hook with a docblock. Here is this one you’re asking about: https://github.com/moderntribe/the-events-calendar/blob/4.6.8/src/Tribe/REST/V1/Endpoints/Archive_Event.php#L67-L94

    Please let me know if you have any follow-up questions on this topic.

    #1425507
    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 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Problem with REST API’ is closed to new replies.