I'm facing following issues while fetching facebook user/pages/group timeline posts:
- I'm not getting all information (photos urls, link, created_time, etc) in posts objects retrieved using this. Following is a sample response of this api:
[ { "message": "this is going to be real fun https://localhost.com/N1AyEvZp", "story": "Rajveer Singh added photos to XYZ Photos in My-group.", "updated_time": "2015-09-03T16:27:34+0000", "id": "405944472923733_413853035466210" }, { "message": "this is going to be fun https://localhost.com/EJo1WvZp", "story": "Rajveer Singh added photos to XYZ Photos in My-group.", "updated_time": "2015-09-03T16:14:41+0000", "id": "405944472923733_413848848799962" }, { "message": "this is going to be some real funhttps://localhost.com/VyVKdWga", "story": "Rajveer Singh added photos to XYZ Photos in My-group.", "updated_time": "2015-09-02T15:45:08+0000", "id": "405944472923733_413582785493235" } ]
This response is missing the photo urls, links, captions, etc from the posts. Is there any different api for fetching those informations ? Also, if I directly hit the one of the post object /405944472923733_413582785493235 then I get following response:
{ "created_time": "2015-09-02T15:45:07+0000", "message": "this is going to be some real funhttps://localhost.com/VyVKdWga", "story": "Rajveer Singh added photos to XYZ Photos in My-group.", "id": "405944472923733_413582785493235" }
Though I get created_time in this response but pictures, urls, are still missing. I found this api deprecated. Is there any different api which can give me all the info ?
- The above response is also missing comments and replies. On google search I found that we can get comments using /405944472923733_413582785493235/comments api but again that api doesn't mention the exact comments count. Also, the api doesn't give all the comments in a single api call. They have a pagination kind of thing. Can anyone tell me how can I get exact count of comments, replies to comments, and retrieve all the comments in a single api call. If we can't retrieve all the comments in a single go, then how can we use pagination ? I need to send all the comments related to a post to my front-end. with pagination, how can I achieve that ? Do I need to store the previous/next urls somewhere in front-end ? Following is a sample response of this:
{ "data": [ { "id": "[post_id]", "from": { "name": "[name]", "id": "[id]" }, "message": "[message]", "created_time": "2011-01-23T02:36:23+0000" }, { "id": "[id]", "from": { "name": "[name]", "id": "[id]" }, "message": "[message]", "created_time": "2011-01-23T05:16:56+0000" } ], "paging": { "cursors": { "after": "WTI5dGJXVnVkRjlqZFhKemIzSTZOREUzTVRJeE5qWTRORGN5Tmpnd09qRTBOREl3T0RRd09URT0=", "before": "WTI5dGJXVnVkRjlqZFhKemIzSTZOREUzTVRFNU16RTRORGN5T1RFMU9qRTBOREl3T0RRd05qZz0=" }, "previous": "previousUrl", "next": "nextUrl" }
- How to get count of all the likes and shares of a post ? I simply want the count and doesn't want who actually likes/shared the post. How can I get that ? I found that using /likes gives a list of all those who liked the post but it doesn't give the count. Following is a sampple response of that:
{ "data": [ { "id": "824565440992306" } ], "paging": { "cursors": { "after": "ODI0NTY1NDQwOTkyMzA2", "before": "ODI0NTY1NDQwOTkyMzA2" } } }
General Information:
- I'm using Node.js Javascript SDK for hitting FB APIs.
- I'm using correct access token, so that's not an issue for sure.
- I have gone through this and this but didn't get any help from them.
I need all the information related to wall posts on my back-end so that I can send all data to my front-end for proper rendering. This is a screenshot of my front-end and all the information which I need in front-end.
Can anyone please try to clear my doubts ?
Also, if there is any optimized way of fetching all this information, then please do suggest. Your suggestions are welcome.