【问题标题】:Eventbride API time_filter parameter NOT workingEventbrite API 时间过滤器参数不起作用
【发布时间】:2020-07-16 07:52:00
【问题描述】:

所以我一直在尝试使用time_filter 参数来获取我当前和未来事件的列表(所以没有过去的事件),但我得到了所有的事件;所以这个参数对我不起作用。很奇怪,因为像 'expand=venue' 这样的其他参数确实有效,但是当我尝试 time_filter=current_future 时,它不起作用,而是我仍然收到所有事件,包括那些已过期的事件。

这是我用来调用 API 的 AJAX 代码:

        $.ajax({
            type: 'GET',
            url: 'https://www.eventbriteapi.com/v3/users/me/events/?time_filter=current_future&expand=venue&token=MYTOKEN',
            dataType: 'json',
            contentType: 'application/json'
        }).done(function (result) {
            //result code goes here
        });

这里有没有人成功使用time_filter 参数,如果是,我做错了什么?因为该参数是 GET 调用忽略的唯一参数,因此我使用的所有其他参数都可以正常工作。任何帮助表示赞赏。

谢谢!

【问题讨论】:

    标签: json ajax api get eventbrite


    【解决方案1】:

    找到了解决办法。删除 contentType: 'application/json' 解决了这个问题。我不知道为什么,也许是因为我没有发送数据,所以它可能会妨碍我尝试发送的参数。无论哪种方式,对于那些使用 Eventbride API 并且不发送自定义数据并且还希望使用 time_filter 参数的人;然后删除contentType: 'application/json' 即可解决问题。

    这是工作代码:

        $.ajax({
            type: 'GET',
            url: 'https://www.eventbriteapi.com/v3/users/me/events/?time_filter=current_future&expand=venue&token=MYTOKEN',
            dataType: 'json'
        }).done(function (result) {
            //result code goes here
        });
    

    【讨论】:

      猜你喜欢
      • 2017-07-31
      • 1970-01-01
      • 2019-07-08
      • 2015-10-15
      • 2018-02-27
      • 1970-01-01
      • 1970-01-01
      • 2021-08-03
      • 2023-03-07
      相关资源
      最近更新 更多