How can I get posts on my wall by another user via the Facebook API - facebook-graph-api

My goal was to get every from my wall post and process the posts.
When making a request, I would get back a response missing a newer message that was posted by another user.
This is seen in /user/feed (https://developers.facebook.com/docs/graph-api/reference/v2.1/user/feed), which is described as:
The feed of posts (including status updates) and links published by this person, or by others on this person's profile.

There are several cases that stop this from happening, one of them somewhat hidden in the docs and the other un-mentioned.
To have something appear:
both users must have authenticated with your app.
the sharing user must not have hidden status messages from apps in their privacy settings.
The first one is less intuitive, but it requires that the user who is authenticated both have the ability to see it if they were on the site, but that the originating user must also have authenticated with your app.
The second one makes sense, but is unmentioned and can be a frustration if you forget turning that setting on years prior.

Related

disabling facebook comments with actions field on wall posts

My app allows users to interact with each other for a unique purpose. As part of this experience I post on user's wall so his/her friends can know about the post from user and they can come to app for interaction. But in this case, users may just end up commenting on the facebook page itself and my app will not have any knowledge of this interaction. To avoid this, I am wondering if I can disable comments on this post. Graph API documentations states that I can use the "actions" field on wall post for such purpose. I tried that with various combinations of Comment and empty link or link that takes the user to my app etc. But I notice that no matter what I set, facebook always shows link to the wall post instead of what I tried to put.
Any thoughts on how to achieve this purpose?
Thanks.

Django and Post to Facebook (no authentication)

OK, I need some help understanding the process behind Facebook's website integration process and how I can integrate it into my web app....
In its most basic form, my site stores and displays users' comments about products (there's more to it than that, but that's all that's relevant for this question). What I'd like to do is allow them to post that comment, together with the name of the product (and my site), to their Facebook wall by clicking a button.
I do not need the users to log in to my site at all, either with Facebook or any other authentication system and the Post to Facebook part is optional.
Obviously if they decide they do want to post their comment to Facebook, then they'll need to login, but I'd rather temporarily take them away from the page to login, post and then be brought back to my site.
What I need to know is how much of Facebook's APIs, Open Graph and Auth systems do I actually need to integrate?
I had hoped that I might be able to generate a simple link to Facebook with their comment embedded as a POST element...?
I'd be really grateful if someone could point me in the right direction!!
(P.S. I need a similar solution for Twitter, but I think that's easier!?!)
The Feed Dialog doesn’t allow including of a pre-set message any more, so you’d have to make that post via the Graph API if you want to pre-fill the message (and even then, you should only do so, if you’ve given the user the possibility to edit the pre-filled message first).
See here for how to make a post on a user’s behalf via Graph API, https://developers.facebook.com/docs/reference/api/user/#posts
You can do that all client-side, if you embed the JavaScript SDK into your page.
You need to set up an app on FB, then have the user connect to it (using FB.login), ask for the necessary permission (publish_stream) while doing so, and after successful login use FB.api to make the Graph API call.

Action approved - publish_actions still not working

This question has been asked many times before, but they all seem to relate to problems before the Open Graph was 'opened'. As a new user, I also can't make this question useful, i.e no images or links. If you want to see the images I've posted, you'll have to copy and paste.
First of all, my Action is approved.
http://i.stack.imgur.com/hAFHr.png
Additionally, the action shows as being available to all users.
http://i.stack.imgur.com/IrrWW.png
publish_actions has been added to the Auth.
http://i.stack.imgur.com/PdJiA.png
I also have objects and aggregations setup correctly.
The auth preview also shows the correct settings (although the dialog currently doesn't stay open to see it, it used to).
When I try and connect with FB to the site, I don't see publish_actions. Instead I see the second stage of the dialog, for publish_stream. I set this by mistake the first time I saved the app, but quickly changed it.
http://i.stack.imgur.com/n819f.png
http://i.stack.imgur.com/gkXfg.png
This is where I think it gets even stranger. If I take a look at the FB profile for one of the app developers, and click through too the app from there, while not registered, I see the correct permissions.
http://i.stack.imgur.com/SsOVI.png
Yet another twist to the tale, which makes it even harder for me to debug, is that it seems since playing with the aggregations, I can't even get publish_actions permissions despite being listed as an app admin. (I've read that every action needs an aggregation before FB will process any actions sent by the server.)
/**/ FB.ApiServer._callbacks.ff2f1615c({"error":{"message":"(#200) Requires extended permission: publish_actions or App must be on whitelist","type":"OAuthException","code":200}});
That's the error I get when I complete the action on the site, http://purple.fr/boutique
Have I missed a setting somewhere? Have I done something I shouldn't? Should any of this be controlled in the code on the site?
When a user connects to your site, you should be asking for the publish_actions permission instead of the publish_stream permission. The referral dialog settings (where you already ask for publish_actions) only works when a user clicks on the action from within Facebook. It won't work for users already on your website.
In your login function (FB.login), make sure you add the permission publish_actions.
That aside, it looks like it's all working now.
http://i.stack.imgur.com/jAosv.png
http://i.stack.imgur.com/Wbgf5.png

Some feed messages return false in graph

I have tried posting to some different friends feeds. Sometimes the message does not show up on feed even if a get a "good" response back with a new graph api ID.
100002842168248_146917358746335 does not work for example
I don't get any errors or similar only a new ID for the post and when I try to access via graph api (developer console on FB) it return simply false?
https://graph.facebook.com/100002842168248_146917358746335
Using the same call but for another user is showing up on facebook feed without problems. Is there any more action I can take or should I simply take my "false" and give up.
It's probably a privacy/permission settings issue. If the user who's Wall you are posting too has it set so only Friends can view their Wall, you will not be able to view the post (via the Graph or otherwise) - even though your App made the post.
You can also get 'false' if, although the post is visible on Facebook.com with no problems, the user who posted it has opted out of Facebook Platform. This is a privacy setting which disables any apps from accessing any information about a user, their posts, etc.
Even if their posts are 'Public' on facebook.com, the API won't return anything about such users.

Get apprequests available to user, sent by other users

BUMP: This is not a dead request. I'm still hoping to get a solid answer from someone at Facebook or anyone else. Thanks.
Revised Inquiry: I don't know if I'm not asking the right question, or if I'm asking a valid question that no one can answer.
New Questions:
Can we use FQL or another means to get all of the requests seen at reqs.php? I'm essentially looking for something like this:
SELECT request_id, app_id FROM apprequest WHERE recipient_uid = me()
Notifications return that data but app requests are often batched into a single record with a link identifying some but not all requests. I want individual records for all app requests currently open. The data to do this must be available, as this is the data used to build notifications! It just seems that this is not being made available to us. :(
Thanks!
Original Inquiry Follows:
I have an app that aggregates various sources of Facebook information for a user. One of the sets of data I'm working on is the collection of apprequests which have been sent to this user by friends. For example, I open GreatApp and click to send a request to you. You may or may not use GreatApp but let's assume you haven't blocked requests from it. You now open my AggregatorApp that shows my request to you, and the included link back to GreatApp. The data you see is the same as at reqs.php but formatted differently, with much more data, and of course simply much better. ;)
I thought that is what we got in apprequests. From this question I'm understanding that apprequests is a collection of requests sent out by the current application.
When using path/me/apprequests, we don't need to specify an app ID. But I believe here we do need to provide an app token rather than a user token. Is that correct? If that's correct then this confirms that the requests are those that this app sent out, not requests generated by other apps.
When using FQL, we need to identify the uid of the app as well as the id of the request in order to query the apprequests table. I get that, but even with a valid request id and app id (and valid permissions) FQL doesn't return request data. (I haven't checked with an app id, maybe that's the key.)
I am hoping people will provide some concrete examples for any of the above, specifically getting inbound requests from other apps, and confirmation about what token or other detail is expected for /apprequests and the apprequests table to return data.
Thanks!
Other threads asking the same question without a good (or any) response:
thread1 thread2
You need to make a graph api request to get the apprequests connection for a user. See the current documentation here: http://developers.facebook.com/docs/reference/api/user/.
In the Connections table, the documentation correctly notes that you need an application access token to retrive the requests to that user. There's a bug in the documentation under (http://developers.facebook.com/docs/reference/api/user/#apprequests) that claims you need a user access token. This is incorrect, and (as you've seen) will return an empty list of requests.
Requests sent by an application are only visible to the application. The user can't see or delete these requests (though they are able to hide the request). The reason for this is that the applications can put data into the requests (255 characters) that's never exposed to the user or other applications.
I don't think there's a way you'll be able to aggregate a user's requests from apps that you don't have an access token for.
What I have found out (before my question was deleted) was that you can't access requests with a user token, and app tokens can only access requests that app has sent (and I found that out myself in the documentation and playing with the graph explorer). Since I know there are iPhone apps and browser plugins for processing requests, I assume they are accessing the page itself and parsing the data (like scraping a site). The downfall to that approach is that on the request page only around 100 requests from each app are shown at one time.
(Unless some people have found a way that they aren't sharing...)
You are right, you need the app_access_token and not the user_access_token.
I think the FB documentation has an error.
The definitive answer was provided by a Facebook developer here in response to my bug report. The resolution is that this is By Design. This relates to the note by #noah-callaway that there's probably some app-specific data in requests that should not be available to other apps.
This is a shame, in my opinion, because as Facebook is all about sharing data among friends, I think it adds a dimension to the ecosystem when apps can share (limited and reasonable) information among one another.
Thanks for the responses!