Get family relationships from Facebook - facebook

How can I query a data on my friend's family relationships on Facebook (assuming they are visible to me normally)? Getting something like a JSON object as the response would be fine.

Via graph API it will be:
https://graph.facebook.com/UID/family
which requires user_relationships/friends_relationships extended permissions
OR FQL
SELECT profile_id, relationship FROM family WHERE profile_id =

Family appears to be accessible as an array under the User class via FQL.
See documentation here

Related

Facebook Marketing API Select Fields

i want to get only offiste conversions within this marketing api call:
https://graph.facebook.com/v2.8/<ad_id>/insights?fields=actions{"action_type":{"offsite_conversion"}}&access_token=<token>
but i get all fields in "actions". any idea what i'm doing wrong?
You can use parameter:"filtering"
https://graph.facebook.com/v2.8/ad_id/insights?
&fields=actions&action_breakdowns=action_type
&filtering={{"field":"action_type","operator":"CONTAIN","value":"offsite_conversion.fb_pixel_complete_registration"}]&access_token=token

Facebook API 2.8: Getting Members of a FriendList object

I am trying to list all friends who use my app and belong to a FriendList object. The FriendList object could be, for example, 'Close Friends', or 'Family'. I understand that I can get a full list of friends who use my App using the /me/friends endpoint, but that's not what I am looking for. I need only those who belong to a given FriendList.
When I GET /{{friend-list-id}}/?metadata=1 the metadata shows a 'connections' object with a 'members' property. The value of the members property is:
https://graph.facebook.com/{{friend-list-id}}/members
When I hit this URL (and include my access token), I get a FacebookResponseException with the message '(#12) Unavailable in this version'. I am using API v2.8.
Is it really the case that I can't get the contents of the FriendList? (Remember that I am only needing those that use my app).
Alternatively, is there a way that I can filter the /me/friends response so that it includes only those who are on a given FriendList?

Facebook Graph API: Find graph object from post URL

Given the URL of a public Facebook post, how can one find the post object in the FB Graph API? (secondarily, why are so many user feeds empty or nearly empty when accessed through the API?)
We would like to be able to comment on or like a post via the v2.x
Graph API, given the post's URL. Doing so requires the post's object
ID, which we can make some educated guesses about, but accessing
the actual object through the API has proven unreliable (works for some posts but
not others).
v2 of the API introduced app-scoped user IDs, and post IDs generally seem
to be of the form {app-scoped user id}_{unique post id}. Here are the
details of some attempts to find posts in the API with various combinations of
these IDs (global user id, app-scoped user id, and post id).
Starting with a simple example: https://www.facebook.com/evan.prodromou/posts/10153023417510505. Key characteristics are that it's public, it's not a share of another post, and most importantly it has no photo(s), which add extra ids and URLs for the individual photo(s) and photo set. Evan's profile is also public, i.e. https://www.facebook.com/evan.prodromou doesn't show the generic This content is currently unavailable
Trying the bare post id from that URL, /v1.0/10153023417510505 and /v2.2/10153023417510505 both give the Unsupported get request (code 100) error.
Evan's global user id is 525575504. Attaching that as a prefix, /v1.0/525575504_10153023417510505 and /v2.2/525575504_10153023417510505 still both give the same Unsupported get request error.
Same error using his app-scoped user id instead, /v2.2/10152350676805505_10153023417510505.
OK let's try the other direction. We'll page through the user's feed until we find the post in question. It feels like this is more the expected use case for the API...
Both the global /v2.2/525575504/posts and app-scoped /v2.2/10152350676805505/posts return nothing, but /v1.0/525575504/posts returns two recent posts, this like and this post. Not sure why only those two, even though has plenty of other recent public posts. The like is fetchable via its id field in both api versions, i.e. /v1.0/525575504_10153045879215505 and /v2.2/10152350676805505_10153045879215505, but both API versions return the Unsupported get request error when fetching the post via its id field, e.g. /v1.0/525575504_351575675029953 and /v2.2/10152350676805505_351575675029953
Trying another public post, this one with pictures: https://www.facebook.com/andigalpern/posts/678121182314631 . /v1.0/100003502653187_678121182314631, /v2.2/100003502653187_678121182314631, and /v2.2/499657186827699_678121182314631 all error.
/v1.0/100003502653187/posts only includes one post, a like, and /v2.2/100003502653187/posts is empty.
For reference, here is the GitHub issue where we have been tracking this problem.
Basically you would need read_stream for this (which your app will not get granted). And yes, even though the post is public, you still need read_stream to be able to get read access to all kinds of posts.
You can easily play around with this in Graph API Explorer. First give your app read_stream permission to get ids of items in your feed – that will give you ids of the “form app-scoped user id underscore post id”. Then remove read_stream (by clicking “Get Access Token” again and using the “Clear” button), and try several of the user_* permissions – and you will see that for most of your posts, even the public ones, you will still only get “Unsupported get request”, which just means you are not allowed to read that object.
F.e., I have a public post where shared a video post from another page on my timeline, the type is video and status_type is shared_story, but neither user_status nor user_videos allow me to read this post – only when I grant read_stream again, my app can read that post. Same with another public post of type status and status_type mobile_status_update – readable with read_stream, not with any of the user_* permissions.
In short: What you want to achieve is not possible any more with API v2 and the restriction that read_stream will only be granted to apps on platforms where no official FB client exists.
A one proposition is to make api calls to write facebook posts since those return valid post_id that you could use
Second,
When you try https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&path=525575504%2Fposts&version=v2.0&
You can see that his posts ID's are not starting with his public id as you wrote 525575504_*
but they still put unsupported get request
https://developers.facebook.com/tools/explorer/256884317673197/?method=GET&path=10152853212485505_351575675029953&version=v2.0
Third since above doesnt work are those posts public for sure?

get Facebook Group Id using identifier or url

I would like to get a facebook group id by using a URL or specific identifier.
For ex: http://www.facebook.com/groups/chennaifoodies/ should give group id 194462073956868.
Is there way to get the group id by using above URL or identifiers like 'chennaifoodies'?
If I tried https://graph.facebook.com/chennaifoodies, then it gives the fan page id.
I think 'wallflux' has done a wonderful script, so I need a script like that to get group the id.
is there any way to get a group id using graph api or fql?
Thanks.
I don't think you can get the Group ID from the url you mentioned with the group username.
But, you surely can get the same with the url:
http://graph.facebook.com/search?q=chennaifoodies&type=group&access_token=ACCESS_TOKEN
Yes, you'll be needing an active user access token to query this.
Or, the graph API (the same thing)-
/search?q=chennaifoodies
Demo

facebook, how to get many user's profiles details by id's array

How i can get users details in FB by their id?
I have ids array, and i need to get all user's profiles by one query from ActionScript, is it possible?
This example is taken from the very first page of the Graph API Documentation under the 'selection' heading:
You can also request multiple objects in a single query using the
"ids" query parameter. For example, the URL
https://graph.facebook.com?ids=arjun,vernal returns both profiles in
the same response.
This works with the ?fields selector too, so you could also do https://www.graph.facebook.com/?fields=id,name,picture&ids=<CSV LIST OF IDS>