4

I try to get a list of all events attended by all friends on facebook. Here is the query:

SELECT name, venue, location, start_time, eid FROM event 
WHERE eid IN (
       SELECT eid FROM event_member 
       WHERE (uid IN (SELECT uid2 FROM friend WHERE uid1 = me())  OR uid = me())
   )
AND start_time > now()

Although I can see my friends attending certain events on facebook.com/events/list, the result of the FQL query is an emtpy array.

Does anyone have an idea why?

Thanks.

Update:

I've added the user_events and friends_events permissions as suggested in the first answer, but the returned list is still empty.

Community
  • 1
  • 1
Nikolay Tsenkov
  • 1,128
  • 10
  • 26
  • I've tried that, but I get { "error": "Request failed" } from the Graph Explorer. First, I've tried without permissions and I got empty data. Then, I scope user_events and friends_events permissions and I'm still getting "request failed" error. I also added LIMIT 20 but nothing. Am I missing something? – whitenoisedb Mar 17 '14 at 03:33

1 Answers1

2

Your query is ok.

  • Just add LIMIT 20 for example if your query takes a took long time,
  • Add the user_events and friends_events permissions.

Doc: https://developers.facebook.com/docs/reference/fql/event_member

Update:

Permissions should be set in the cloud & then requested on login from your client. Here is the login:

FB.login(callback, {scope: 'user_events,friends_events'});
Nikolay Tsenkov
  • 1,128
  • 10
  • 26
Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
  • I have set these permissions (in the User & Friend Permissions field), but still no-joy. I can see there are future events attended by my friends, but these are not returned as a result from the query. :( – Nikolay Tsenkov Oct 18 '13 at 05:37
  • 1
    I didn't request the permissions from the client app. Updated your post and marked it as an answer. Thanks. – Nikolay Tsenkov Oct 25 '13 at 08:22