Retrieve events hosted by a group with FQL

I would like to know how do events hosted by a group connect to that group so I can retrieve all events from a specific group (all I have the group id). This needs to be done using FQL and PHP SDK (I know my way with these, but I am unable to find anything about connections between groups and events).

Upvotes: 0

Views: 1114

Answers (5)

dave
dave

Reputation: 90

Meanwhile, GROUP_ID/events works pretty well for me here.

It was possible with REST API if you look at this: http://developers.facebook.com/docs/reference/rest/events.get/

They say: "The uid can be replaced by gid in order to get events hosted by a group instead of by an individual user."

I tried to get events of groups I have joined via the Graph API Explorer and it worked as well as a little restFB (Java) implementation I made.

So, could it be a permission issue at your site?

Upvotes: 3

wallflux
wallflux

Reputation: 430

Try the updated Wallflux-events: http://wallflux.com/events/115227675156013

Upvotes: 0

Akaoni
Akaoni

Reputation: 1033

Facebook has broken this one before. : (

Will see if I can trace down how we got it fixed last time.


In the mean time, the closest I could get is:

https://graph.facebook.com/fql?q=SELECT eid, name, host FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = $uid AND start_time > 0) AND host = '$group_name'&access_token=$token

Variables:

  • $uid = uid of a group admin
  • $group_name = name of the group
  • $token = access token for the above group admin with user_events permission

Only downsides I can see are:

  1. An auth token is required (even for a public group); and
  2. The admin used must be invited to all events (this is usually the case anyway). If the admin isn't invited, it appears that the event won't show up.

Update: Facebook bug report - please add your support so we can get this fixed: http://developers.facebook.com/bugs/197158423732088

Upvotes: 0

filincoln
filincoln

Reputation: 1

Up until a couple of weeks ago the following would do exactly what you need

SELECT name FROM event WHERE eid IN
(SELECT eid FROM event_member WHERE uid = <uid from group>)

but the api changed to using group objects so the code does not work anymore. Sadly, I have not found another way to get the events from a specific group.

Upvotes: 0

Nitzan Tomer
Nitzan Tomer

Reputation: 164137

Doesn't look like you can pull that off.

The documentation of the Group object does not mention a collection of events, and if you try to get /GROUPID/events from the graph api you get an error saying "Unsupported get request".

The fql documentation of the group table also has nothing on events, and the event table is only indexed by the event id which means that there's no way to connect between events and groups.

Upvotes: 0

Related Questions