How to determine privacy status of Facebook post using graph API? - facebook

I'm using the Facebook graph API version 2.0 in Node, via the fbgraph module.
I'm posting to a user's feed with the token they've authorized. While authorizing, they are able to choose what privacy level my app will be posting at, by default.
Ideally, I'd love to know what privacy level the message was posted at in the response from Facebook from the posting process. But there doesn't seem to be a way to do that.
So now I'm trying to use the Graph API to request details on the newly posted message, to determine it's privacy level. In their docs, they show a "privacy" field that should come back, with all of these details. But when I actually use their Graph Explorer tool to test this out, I never get back that field. If I explicitly request the privacy field in my call, it says it doesn't know what that is. "(#100) Unknown fields: privacy."
By default I'm getting back: id, from, message, updated_time, and likes.
How are we to find out the privacy level of a post on Facebook?

Related

Facebook Graph API unable to get comments from user's post

The Facebook Graph API seems no way to get any comments other than user itself posted from users' any Post, Album, Photo or Video nowadays. The /{object-id}/comments doc said A User can only query their own comments. Other users' comments are unavailable due to privacy concerns., also For the following nodes, the /comments endpoint returns empty data if you read it with a User access token:.
Does it really means Facebook Graph API unable to get user post's full comments in any way?
If this is for "personal use" your own user token then yeah you won't have a choice to bring anything else but if you're using a Page Token for a page that you manage then you can get the posts and comments but I'm currently unable to get the Comments "from" data so I can know who the User is (Name)

Azure Logic apps Facebook connector gives empty response

When I try to use the Facebook connector in Azure logic apps I can't seem to get the "Get user timeline" to work.
I know for a fact that the User ID is valid (I checked using this URL: https://www.facebook.com/profile.php?id=). I also know for sure that the user has posts on it's timeline. I also tried multiple user ID's.
When I open the failed request in the Logic app I get this, the response is empty every time.
Is this related to privacy settings? Why doesn't this work?
We should probably retire/remove that operation. It is not possible to retrieve the post from Facebook graph API for another user's timeline. It used to so that is why it is there. Specifically, this post might be helpful: Facebook Graph API {user-id}/feed from others empty
The connector calls the /{user-id}/feed API. You can try out the behavior in the Facebook Graph explorer as well. https://developers.facebook.com/tools/explorer/

Facebook Graph API /{page-id}/feed not getting all posts

I am using /{page-id}/feed endpoint of Facebook Graph API to get the feed from a particular page.
There in the response a post from an user to the page is missing, though from facebook portal I am able to see that post on that page. As that post is visible there I can assume that is public.
Another post from the same user on a different page is also not coming in response.
Any idea on why the post is not getting returned ? also I need details about what kind of data is not supported by facebook page feed API.
Your answer will be really appreciated.

Add/Invite Users to a Facebook group using Facebook Graph API

I've got an iOS app using Corona(ie. in LUA; not ObjectiveC; though I'm not requesting specific Corona help, just how to do this in general) that I want to add or invite users of the app to the Facebook group. I've had success with members of the group posting to the group's wall from my app, but can't for the life of me get the "Invite Users" bit of code to work for people who aren't yet members of the FB group.
All of the posts on this website say it either can't be done (presumably because they're from before the Groups API was available) or just repeat what the Facebook documentation says (which I've read a million times, but maybe don't fully understand).
From Facebook's Group documentation (https://developers.facebook.com/docs/reference/api/group/)...
"Applications can invite users to a group by issuing a POST request to /GROUP_ID/members/USER_ID with an app access_token."
After figuring out how to get the app access_token (as opposed to the user access_token), I've tried using 3 different methods to test this out; Corona's facebook API request() command, making a PHP page with the command, and even tried Facebook Graph Explorer to try this code and nothing works.
All of them along the lines of...
https://graph.facebook.com/myGroupID/members/nonMemberFBUserID?access_token=myAppsAppToken
Corona gives me an HTTP 200(which should mean OK) but the facebook request returns an error (I've got a question in their forum, but I don't often get much help from them). My website PHP page returns an empty data object ala: "{\"data\":[]}". And the Facebook Graph Explorer just lists all of the existing members along with some cryptic "paging" object with a "next" web address in it. If I go to this address directly, it says:
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104
}
}
But I passed an access_token as a parameter! Does this mean I also need to pass a user access_token? And if so, what do I call it, if the access_token variable is already used for the app's access_token?
The reason why you are getting an empty json object is because you are doing a GET request. if you change it to a POST request it should work.

Any way to check the validity of a Facebook feed dialog via direct URL's returned post_id?

I'm letting Facebook users post a link to their feed in exchange for something. For simplicity, I'd like to use the 'Direct URL' method of initializing a feed dialog
(see "Direct URL Example" # http://developers.facebook.com/docs/reference/dialogs/feed/)
which I understand returns a post_id upon success. My question is: *is there anyway to check the validity of this post_id?*
Can I then query the Facebook API for confirmation of this post_id? Couldn't anybody just hit my callback_uri with the post_id parameter set and make it look like they successfully posted to their feed?
You can check the existence of post by issuing request to Graph API just after receiving callback in JS-SDK or visit of your redirect_uri for direct flow of Feed Dialog (you'll need an active user access_token to ensure that post is exists and read_stream permission to ensure that post created using your application):
https://graph.facebook.com/POST_ID?fields=id,application
Once you get the response you can check that application's id in post is matching your application.
Here's the fun part. I've experienced this first hand (as well as other stackoverflow users). If you check the post_id via the api, it might return blank!! But if you check after a short period of time (like 90 seconds), then it comes back with the data. So you can check the validity of the post_id at a latter point, but not directly right away.