Manokaran K
Manokaran K

Reputation: 296

Even though Facebook API returns 'code' 200 for some 'nodes', when accessing the webpage it return 404

I'm developing a web app that uses FB data for some FB posts. I have a bunch of post ids and am fetching the data related to them using batched requests. Then am showing a summary of each post (number of comments, shares, likes) and link to the actual FB page (https://www.facebook.com/). But clicking on the link shows a 404 page on FB!!

Example, the node_id, '69983322463_10152179775342464' will return data in the graph explorer. But when you access https://www.facebook.com/69983322463_10152179775342464 it returns 404!

In case my question is not clear: GET https://graph.facebook.com/69983322463_10152179775342464?access_token={a valid access token} returns data. But GET https://www.facebook.com/69983322463_10152179775342464 (with or without an access_token param) returns a 404

Is there some field in the API response that signifies that the page does not exist anymore?

Thanks, mano

Upvotes: 1

Views: 496

Answers (1)

Sahil Mittal
Sahil Mittal

Reputation: 20753

This is because not every post is public. Only publicly available posts can be accessed directly.

For rest you need a valid access token to GET its details. When you tried the post id in graph api explorer it showed the result since an access token was applied.

So, you simply use a valid access token, may be any app access token (app_id|app_secret)- that never expires, and make the /GET request.

Eg: \GET /69983322463_10152179775342464?access_token={app-access-token}

Upvotes: 0

Related Questions