Facebook API 2.8: Getting Members of a FriendList object - facebook

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?

Related

facebook test user no graph API search place result

I have created a test user for my app under development (not public yet), and using the access token generated for the test user to call graph API.
The graph API I am trying is search place (/search type=place distance=1000).
And I specify my current location as parameter.
However, I only get the following data in return:
{"data":[]}
If I specify distance=10000, I get a few place names, but this result is totally different from my result with ordinal (non-tester) user.
Using access token for non-test-user, I get 100s or more place names.
Question:
Why this difference?
Any setting needed for test user creation so that its graph API search result is the same as the ordinal user's?
(In case it is a limitation of test user, how I can test an app which use graph API, with a test user?)
Any help or clue is highly appreciated!

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?

Facebook Graph API: How to check if an object is a user and not another type of object

Of course you can use http://graph.facebook.com/{object_id} to get a JSON response for that object. However, for my application I want to determine if the object returned is a user and not a page, group, or any other object. Or in other words, I want to query only users.
Is this possible?
I've looked through the Graph API docs, but I can't find a way to ask/query for only users.
This is possible by adding the
metadata=1
parameter in the GET request URL like this:
http://graph.facebook.com/{object_id}&metadata=1
The response will include a type field, which contains the object type of the object you requested

Unable to create custom facebook object

I'm making a Facebook canvas application, and I want give some of the objects there "Facebook presence" - I want to allow users to comment on them and to like and share them via Facebook.
I understand I need to do it via OpenGraph. So I created an object type on my OpenGraph and named it item. I've tried to create an instance of item with the following POST request:
url:
https://graph.facebook.com/https://graph.facebook.com/me/objects/ilender_local-test:item
body:
method=POST&object=%7B%22type%22%3A%22%5C%22ilender_local-test%3Aitem%5C%22%22%2C%22title%22%3A%22My+First+Item%22%7D&access_token=...
The access_token, ofcourse, is the access token for my app.
Now, the result I get is a simple JSON false - no error message - but I assume I failed since when I succeed in creating an object on Facebook I usually get the id of the newly created object.
What am I doing wrong?
My stupidity knows no end. https://graph.facebook.com/https://graph.facebook.com? What was I thinking...

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>