FB Graph API : Get post engagment and people reached - facebook-graph-api

Is there a way via Graph API to obtain engagment and people reached about a post?
I am the admin of that page, so I have a page_token.

Ok, solved.
The permission "read_insights" is needed and then just select the field "insights" of the page and there are all the stats.

Related

Extract my timeline posts from Facebook Graph API

I am trying to extract my posts, via Graph API from facebook. I used some basic code snippets but they don't work. I can not get my feed even in the Graph Explorer. It always says that I don;t have the permission and I have to submit my App for review and provide a video tutorial on how I use the extracted posts.
But I want to extract just my posts, I don't care for anybody elses. Do I seriously need FB App review to do that?
This is what I get with my token from my app:
user/posts requires additional contract signing:
Use /me/posts with your own App, with your User Token and authorize with the user_posts permission. This works without any approval from Facebook - for your account and your App only, of course. I just tested if it still works in the Graph API Explorer and it did: https://developers.facebook.com/tools/explorer/108138225915615/?method=GET&path=me%2Fposts&version=v5.0

Montreal Canadiens Facebook Graph API returns no posts

I'm using the Graph API to return Facebook posts from all NHL teams. Every team returns the posts fine except for the Montreal Canadiens, which returns no posts. I verified that there are posts on their wall, and that the Facebook ID that I used is correct(see here)
I get back an empty JSON list when I try using this link for the Canadiens:
https://graph.facebook.com/110877132302973/posts?access_token=(my access token)&limit=10
Any help would be appreciated! Thanks.
Haotian
The posts on that page all have a custom privacy setting - you need to make sure you're attempting to access them using a User access token for a user that meets whatever restrictions they've applied.
App or page access tokens won't be able to see the posts, nor will user tokens for users who don't meet the restrictions

Facebook Graph API does not return comments from a specific user

I am using the Graph API to retrieve the comments attached to a status update on a Facebook Page using a URL of this form:
"https://graph.facebook.com/status-ID/comments?access_token=XXX"
The above URL does not return any of the comments from a specific user while comments from all other users posted before and after that user’s are returned. Any idea what could be the cause of this?
Thank you.
This user has modified their Facebook Privacy Settings in the section How people bring your info to apps they use so that while you can view their comments via Facebook directly, you cannot view that same info via a Facebook App.

How to share someone's post using Facebook Graph API

My Facebook App posts messages on user wall. I want to share this messages on my wall, same as I click share action under user message. How can I do it using Facebook Graph API?
Yes, you can share using the graph2 api. The way you do it is to use /feed edge and pass the post's url that you want to share as the link.
POST /v2.2/{page-id}/feed HTTP/1.1
Host: graph.facebook.com
link=https://www.facebook.com/{page_id}/posts/{post_id}
Standard Fb permissions to the post you are sharing do apply.
https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed
This was done today, in a local rails app, using FbGraph2 gem, with the above method.
According to the permissions for accessing posts via the API, it would appear that you cannot do this as it would require accessing the post of another user's timeline that you don't have permissions/an access token for.
Edit From further reading of the documentation you definitely cannot do this: https://developers.facebook.com/docs/graph-api/reference/v2.2/object/sharedposts#publish

Facebook Page - Get Post feedback and impression via Graph API

I'm trying to get some insights on a list of Posts by a Page on Facebook.
To be specific, I want to get the information highlighted in this blog post via the API.
But I can't figure out how, anyone knows how?
As far as I know it's only possible using the "stream" table. So you've got to use FQL to query this data. Using this technique you'll only get the impressions directly. Feedback rate can be calculated by adding #comments and #likes and dividing the result by #impressions. Hope they'll add this to the insights graph api as well.
MartinHN
Refer to https://developers.facebook.com/docs/reference/api/#analytics
If you are trying to aggregate multiple pages or a page other than the requesting app then you may need grant read_insights permissions to your application.
Refer to http://developers.facebook.com/docs/reference/api/insights/