Wednesday, September 25, 2013

Facebook Post vs Status objects

I spent several hours wrestling with this, so hopefully this will help someone else:

Facebook posts and statuses are remarkably similar. The differences are as follows:
  • Facebook posts are any posts a user makes anywhere
  • Facebook statuses are posts a user makes on his or her own wall/stream
As you may notice, all statuses are also posts. However, the Facebook Graph API treats these objects differently. For one, statuses have far fewer fields. They don't even have a field for something as simple as the privacy_level. Posts are far more interesting/descriptive.

In order to request a post object instead of a status object for a "status" (since all statuses are posts) prepend the user_id of the person who made the status to the id of the post.

So for example querying the Graph API for the object with id "100006765630328_1380118238890351" will return a POST object, whereas "1380118238890351"will return a STATUS object.