The cases involved here:
Using link
If you use the link (www.facebook.com/{POST_ID}) to see the post, you will be able to see the post only if the privacy setting allows current user to see the post. Eg:
- If privacy setting is set to
PUBLIC, any one can see the post with that link
- If privacy setting is set to
ONLY ME, no one can see the post with that link etc..
Using Graph API
Unless the post is not deleted, you can query for the post details using (graph.facebook.com/{POST_ID}?access_token={ACCESS_TOKEN}) whatever be the privacy setting.
Note: If a post is deleted by the user, obviously you wont get any details of the post by any way
----Edit----
Differentiating between `photos` and `status`/`link`
When we wish to post a link or a status message, Graph API consider this as a feed and \POST /feed is used to post it.
And, if we wish to post a photo, \POST /photos is used.
BUT if we want to get the posts using \GET /<ID>/feed, it gives us all the timeline posts be it link or status or photo.
Now, if you notice carefully, the feed result has a key type, that tells you if its a link or a status or a photo. Also, if it's a photo, the API gives you another parameter: object_id which should be used to get a link to that photo.
So-
if type="photo"
link="http://facebook.com/{object_id}"
else
link="http://facebook.com/{id}"