Take the 2-minute tour ×

I can traverse the list of notifications by using FQL. Great. Now, how do I figure out how to get the post/comment to which the notification applies?

Example: The notification is: "UserX commented on your post!"

From the fql table returned, how do I find the post_id or the xid for said comment so that I can find the post and the list of comments?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can call the REST API notifications.getList - https://developers.facebook.com/docs/reference/rest/notifications.getList/

You do not need any permissions beyond the basic.

This will return data including, object_id and object_type.

If object_type is "stream" you can query the stream table with the post_id field set to the object_id from the notifications.getList query. You can get the comments from the stream table.

Example snippet of notifications.getList response:

<notifications list="true">

Your follow-on query:

SELECT comments FROM stream WHERE post_id='12345678_1001251985851'
share|improve this answer
Looks good - no longer need it though. Thanks for the answer! –  Shahar Prish Jul 29 '11 at 15:36

Your Answer


