kinglion9901
kinglion9901

Reputation: 41

Eventbride API time_filter parameter NOT working

So I've been trying to use the time_filter parameter to get a list of my current and future Events (so no past events) but instead I'm getting all the events; so that parameter is not working for me. Is weird because other parameters like 'expand=venue' do work, but when I try for example time_filter=current_future it doesn't work and instead I still receive all events including those events that has expired.

Here is the AJAX code I'm using to call the API:

        $.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
        });

Has anyone here successfully used the time_filter parameter and if so what am I doing wrong? because that parameter is the only one that the GET call ignores cause all the others I've used work. Any help is appreciated.

Thanks!

Upvotes: 2

Views: 246

Answers (1)

kinglion9901
kinglion9901

Reputation: 41

Found the solution. Removing contentType: 'application/json' solves the issue. I'm not sure why, maybe is cause since I'm not sending data then it perhaps steps in the way of the parameters I'm trying to send. Either way, for those using Eventbride API and are not sending custom data and also want to use the time_filter parameter; then removing contentType: 'application/json' will solve the problem.

Here is the working code:

    $.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
    });

Upvotes: 2

Related Questions