Tuesday, February 08, 2011

Oddities of Facebook events API

Using the the Graph API of https://graph.facebook.com/[userId]/events, one can retrieve the events that the user is attending. The same applies to page, using https://graph.facebook.com/[pageId]/events. However, what does it mean by the event attended by a page? It is not the same as the events created by the page, as the API returns less results that what you would see in the events tab of the page. The result return from FQL and REST API are similar.

After spending an entire day figuring out what happens behind the scene, I came to the following conclusion:

  1. User A creates Page P.
  2. User A makes User B also the admin of Page P.

During creation of event:

  1. If User A creates event on Page P, Page P will be attending the event.
  2. If User B creates event on Page P, Page P will not be attending the event.

Unfortunately, as FQL does not allow querying the event by its creator, there is hence no way to fool-proof way to get the events that a page has created.

No comments: