How can i show the wall (feed) of my page to app on facebook? - facebook

How can i show the wall (feed) of my page to app on facebook? As i see in the page
www.facebook.com/kesha?sk=app_178091127385 and
www.facebook.com/pages/Khanduna-Yengu-Nangsu-Amuktang/187317137978077
I want show the wall(feed) of my page to my app of facebook. Please Help me.
I also try and see graph api as below
graph.facebook.com//feed
But Fail,
Please Help any one.

As I understand your question, you want to take the wall of your page and show the content of that on another page controlled by an app you have made, so that is the question I will answer.
There are a couple of things you need to do.
Facebook now requires you to have an access_token to get that information. You can get this in two different ways. Either you get your users permission to grab an access_token for them, or you create an access_token for one of the admin users with offline_access and manage_pages permissions.
There are problems with both cases:
1: Getting an access_token per user requires people to give permissions to your app which is quite annoying if they just gain access to the contents of the feed.
2: Having one access_token is also a problem seeing as Facebook puts a limit on how many requests you can make per access_token in a given time.
You need to balance these things out if you want the feed to be shown. Which case would you most likely use? If you don't have many users the second case might be the best, but if you go over the request limit no content will be shown and that could confuse your users.
Anyways.. Once you are past the access_token problem, you can access the information by getting the content from the page:
https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_ACCESS_TOKEN.
You then get a nice json output you can use. If you are using the Javascript API you can simply use the information here:
http://developers.facebook.com/docs/reference/javascript/FB.api/
If you are ever unsure how to get the information you need there is a nice tool for that developed by Facebook called Graph API Explorer which you can find here:
http://developers.facebook.com/tools/explorer/

Related

Facebook Graph API insights

I'm new on working with Facebook and honestly I found it very confusing, terminology and documentation seems to be very ambiguous in many cases. Can somebody please help me out with a plain english explanation on how I can achive the following?
Post and image to Facebook (on the user page) and then check the stats (insights) of that post.
Till now I have managed to:
1) Create an app
2) Post the image on the user page with the desired message
I'm not able to understand how I can retrieve information about the particular image which was uploaded through my app. I want to know how many people have viewed that image, how many likes did it get, how many times it was re-shared.
Is it possible at all?
I'm posting to /photo not too /feed and I will like to keep it this way if it is possible.
Sorry if this was answered already but I spent a few hours trying to find an appropriate answer but wasn't able to get the right documentation.
UPDATE 1
After having a couple of days off from this topic and receiving the first 2 answers, I took another dive into this. Now I have tried the Graph API Explorer as suggested, and using the ID of a POST I can get some details about the POST, but the insights aren't showing anything, just next and previous.
My goal is to be able to gatther some stats about the pictures uploaded through the app. If this is not possible directly what should be the approach I need to take?
I don't believe a personal /photo has /insights attached to it - the Insights Object documentation page suggests that they do not - but you should be able to get likes, shares, and comments via the API.
It would appear FB has launched a redesign/reorganization of its documentation in the last couple of weeks, but the documentation for the /photo graph object is here -- you will need the user's Access Token, and the API endpoints you're looking for each have links to their own documentation pages there, including example code for each type of request.
Edit (summarizing discussion in comments):
There is no method via the Facebook API to gather insights for all photos posted to individual user timelines via an app. The app can gather likes, shares, and comments for each of those objects individually via API requests, and can make API requests for insights for photos posted to its own timeline. Neither of those options solves the intended use case here.
I'd recommend a solution that uses Sharing rather than an app integration, as this allows for better access to insights on the photos being shared. This is also a much simpler integration, and less brittle wrt future Platform changes. The main tradeoff is that the original photos being shared are expected to expire after a couple of months -- if this is unavoidable, I'd suggest implementing a redirect for requests for expired objects on the site.
We are able to get different kind of photos or picture Using Graph API
like as below:
1.Page Photos
Photos for a Facebook Page.A Page Access Token is required for all methods.Find here
2.Page Picture
Picture belonging to a Facebook Page. Find here
3.Photo
Represents an individual photo on Facebook. Find here
4.User Photos
Photos for a person.Find here
I hope it's helps you.

How to get all the pictures my facebook page is tagged in?

I have a page and I want to run a contest for that page I am the admin of that page. I want people to post pictures on their wall and tag my page in their picture. at the end i want to get all the pictures my page is tagged in using graph api. Is there a way to do this ?. I have tried all the things. I created a app the i got the access token with all the permissions including manage_pages. then i got the page access toke using me/accounts endpoint. then using that access token me/photos/tagged. no luck so far. I am not getting all the pictures.
A little help would be appreciated Thanks.
Your question (and additional info in the comments) suggests that this stems from how Facebook deals with privacy. There are many scenarios in which using a page access token people cannot access content that is owned by a personal profile, even if the admin (personal profile) of the page owns that content.
If you have reason to believe that the API is not returning all the information that it should, you can file a bug with Facebook. If you do, please be sure to include all the necessary steps for them to reproduce the issue or they won't be able to fix it.

Facebook Graph Api me/home Seems To Return Same as me/feed

I know there have already been a lot of questions asked about replicating the users home feed and using me/home, but my question is slightly different.
A few months ago I wrote code to authenticate with Facebook (get user access token) and then retrieve their home feed with me/home. This worked fine at the time as far as I can recall. I've just gone back to the code today, and it doesn't appear to work. The result I get back looks almost the same as me/feed, which is to say it is almost entirely posts from the same account and not posts from 'friends'. Just one post from someone else, a change to their profile pic, shows up but the rest are all 'self posts'.
This only happens with tokens for my own app. If I use graph explorer using the same token, I get the same result. If I use graph explorer with it's own token then it shows me something much more like the actual home feed on the Facebook site. Generating new tokens doesn't help. I have checked the permissions on the tokens used are the same, in fact I even copied the permission list from the generated graph token into my app and re-authenticated, but it didn't help. If my app does the request, then I get almost nothing from other people from me/home. This is the same if I use myuserid/home. Makes no difference.
So my question is, why? Have Facebook changed something and is there a way to change my app so it gets a better version of the home feed?
Secondly, while researching this I've discovered posts saying read_stream won't be granted by Facebook to any app on any platform that has an 'official facebook app'. Does this mean I'm out of luck anyway, even if I get this working for testing purposes using the account that owns the app, I won't actually be able to publish it so others can use it?
Thanks.

Facebook API for Share returning empty results set

I am new to Facebook API. I am building a Facebook app to fetch all the name of people who shared, commented and liked a post in a tabular format. I am able to get the like and comment details through Facebook API but can not find and proper API to get the share details.
I am using
https://graph.facebook.com/post_id?fields=sharedposts&access_token=my_access_token.
This API is returning an empty result set. And I have granted all the available permission to the access_tokn. Can anyone tell me ,Is there any other API that I can use. I saw a option of scraping the Facebook page for share,but I don't want to go that way because Facebook keeps on updating every thing.
I'm having the same problem as you, but I think I'm going a little step forward.
Try adding a limit to your sharedposts and maybe it will return some data:
Try this way:
https://graph.facebook.com/post_id/sharedposts?access_token=my_access_token&limit=1000
That should work for a regular post.
EDIT: Maybe the problem could be that althought you have granted all the perms to the token, the people who share that posts have to accept that permission too.
Otherway your JSON won't return any data.
The /sharedposts endpoint will -only- retrieve posts from users who have -also- granted your app. This means that even though a post might be public on a users' timeline, unless they have also granted your app permissions, you will not be able to retrieve that post.
For example: a user posted to a page and the post is public. This post can be retrieved with an access token. Let's assume that the user also shared this post to their own timeline. But, since the user has not granted permissions to your app, you will not be able to see this post using the /sharedposts edge on the original post (on the page). This also holds if the user shared their post publicly to his timeline.
This behaviour is by design; the API is more restrictive in returning user data than the website is. This holds for multiple endpoint and this is one of the examples where it is the case.
Source: https://developers.facebook.com/bugs/1404733043148335

Facebook - public posts not appearing in Graph?

I am currently trying to get the posts for a specific user from Facebook's Graph API. I have done this numerous times before using a php script I have developed; but the problem this time seems to be on Facebook's end, not mine.
I am trying to get the posts from (replacing TOKEN with an access token):
https://graph.facebook.com/100001558773450/feed?access_token=TOKEN
The graph won't show any posts by the owner of that page but will show everyone else's posts, and as far as I can see the posts are marked as public, and there are no privacy settings set on the account that would stop it from adding the posts to the graph.
Any ideas?
Thanks,
Nick
Check that you have requested the manage_pages permission to give you full access to the page (if you need access as the "page owner").
Using the access_token you've got, according to this documentation there are three different things that you can select feed, statuses and posts.
I'd give those three a go from https://graph.facebook.com and if what you get back is what you require.
https://graph.facebook.com/100001558773450/feed?access_token=...
https://graph.facebook.com/100001558773450/statuses?access_token=...
https://graph.facebook.com/100001558773450/posts?access_token=...
You need to check the "profile" privacy settings (what to share with apps). But most importantly, this is against Facebook ToS!
You can't use a user profile to represent your business, you need to use Facebook pages instead!
More can found here:
Why should I convert my profile (timeline) to a Page?
Since profiles
(timelines) are for meant individual people, they aren't suited to
meet your business needs. Pages offer more robust features for
organizations, businesses, brands, and public figures, which you can
learn more about here.
Further, maintaining a profile (timeline) for anything other than an
individual person is a violation of Facebook's Statement of Rights and
Responsibilities. If you don’t convert your profile (timeline) to a
Page, you risk permanently losing access to the profile (timeline) and
all of your content.