Getting only those Facebook events which haven't expired graph api
Asked Answered
C

2

6

I am trying to get only those facebook events that haven't expired yet(Upcoming events).

When i use the following query i get all the events including those that have expired long ago.

FBRequestConnection startWithGraphPath:@"/me/events"
                                     parameters:nil
                                     HTTPMethod:@"GET"
Contrast answered 2/12, 2014 at 6:56 Comment(0)
V
12

You can make use of the since parameter as described in

if you set the timestamp to the current time, you should only see future events:

/me/events?since=1417508443
Vollmer answered 2/12, 2014 at 8:22 Comment(0)
E
4

You can use time_filter=enum{upcoming,past}. e.g. if you want upcoming events that have not expired yet, send a request like this

/page_name_or_id/events?time_filter=upcoming

In this way you don't have to handle timezone issues as with since=timestamp query.

Erubescent answered 30/8, 2017 at 8:38 Comment(5)
This applies only for page events, not user events it seems.Tackett
This answer is incorrect. The fields time_filter and the key upcoming don't exist anymore. I filled a bug report that the endpoint does not work and they told me it never existed.Agential
@Agential look at the answer date, it is obviously outdated, it was correct answer that's why there are more upvotesErubescent
It still works in v13. .../events?time_filter=upcoming&include_canceled=true&limit=25&fields=id,name,end_time,start_timeMccreary
This also works in v13: ...?fields=events.time_filter(upcoming){cover{source},category,description,id,is_canceled,end_time,picture,is_draft,is_online,name,place,start_time,updated_time,event_times}Mccreary

© 2022 - 2024 — McMap. All rights reserved.