Questions tagged [facebook-graph-api-v2.0]

For using the Graph API v2.0, Your SDK may need updates, or you may need to update the paths you use to call into the graph API.

Changes:

  • In v1.0, there were API endpoints that didn't require an access token to call. In v2.0, all calls to endpoints now require an access token, except for calls to get an object's picture.
  • /me/friends has undergone significant changes. Please see the section above on user IDs and login for details.
  • /me/friendlists has changed. Please see the changes in the login section for more information.
  • The /me/permissions endpoint changed. See the reference for more information.
  • All friend_* permissions have been removed
  • /me/friends returns the user's friends who are also using your app
  • Friends now has a new permission- user_friends

New endpoints:

  • /me/taggable_friends: The new Taggable Friends API. In the past if you wanted to tag friends in a post, you had to get their IDs, names and then pass that information into the post to tag them. With this new API you get a set of tokens that identify friends along with their names and pictures. Using this, it's easy to build a custom tagging interface from your app. If you use this feature, your app will have to go through review before it can tag people in posts or photos. Please note that the tokens returned through this API are not the same as the IDs returned via /me/friends.

  • /me/invitable_friends The new Invitable Friends API. This new API returns a set of people (represented by tokens, names and pictures) in order for you to build your own custom invites interface. Much like the taggable friends interface, the tokens returned here are not the same as the IDs returned via /me/friends and should not be re-used or saved. Using this API does not require review, but is only available to Games on Facebook.com.

  • /me/tagged_places: The new Tagged Places API. This API replaces the v1.0 /me/locations endpoint. The old locations endpoint returned an array of posts, checkins or status messages. The new API returns an array of Facebook Places which a user has been tagged at in photos, videos, statuses and links.

  • /{object-id}?fields=context: The new Social Context API. This API surfaces friends' interactions with objects within your app. You can use on on Pages, Apps, Open Graph Objects and Users to surface social context between the calling user and that object.

  • /me/ids_for_business: The new Business Mapping API. In v2.0 of the API, Facebook will begin to issus app-scoped user IDs when new users login to an instance of your app which is coded against v2.0 of the API. For developers who operate multiple apps (i.e. game developers) the Business Mapping API lets them correlate the same user's app-scoped IDs across the multiple apps owned by the same business. A common use case is for cross-app promotion between games.

Removed endpoints:

  • The /me/username field has been removed.
  • /me/locations has been removed. Please use /me/tagged_places instead.
  • /me/checkins has been removed, along with the user_checkins permission. Please use /me/tagged_places instead
  • /me/questions has been removed, along with the user_questions permission. This also includes /{page-id}/questions, /{group-id}/questions, /{question-id} and /{question-option-id}.
  • /me/subscribers and /me/subscribedto have been removed.
  • /me/username has been removed.
  • /me/notes has been removed.
  • /{page-id}/notes has been removed.
  • /{page-id}/questions has been removed.
  • Public post search is no longer available. (/search?type=post&q=foobar)
  • News Feed search is no longer available (/me/home?q=foobar)

References:

256 questions
373
votes
8 answers

Facebook Graph API v2.0+ - /me/friends returns empty, or only friends who also use my application

I am trying to get my friend name and ids with Graph API v2.0, but data returns empty: { "data": [ ] } When I was using v1.0, everything was OK with the following request: FBRequest* friendsRequest = [FBRequest…
62
votes
1 answer

Get facebook friends with Graph API v.2.0

A while ago, I used to take the friends of mine using Graph API in this way (using Graph API Explorer): /me/friends Everything was perfect but now, with 2.0 version, I saw that this way does not function for friends who didn't use (via Facebook…
51
votes
1 answer

Get ALL User Friends Using Facebook Graph API - Android

I'm trying to get all friends, of a user that logged into my application. I can't use this API [friends]: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/friends Because this API only returns any friends who have used the app…
David
  • 37,109
  • 32
  • 120
  • 141
45
votes
3 answers

Facebook Image URL gets expired

I am pulling Facebook posts using facebook-graph API, now the problem is Image gets expired after few days. I have the following URL for a single Image Old Image URL which got…
35
votes
5 answers

Authenticate the Test User { "error_type": "OAuthException", "code": 400, "error_message": "Invalid platform app" }

I'm trying to recover the access token via the Instagram Basic Display API but when trying to authenticate the test user I get this error: { "error_type": "OAuthException", "code": 400, "error_message": "Invalid platform app" } I expect…
Felice Caricati
  • 353
  • 1
  • 3
  • 4
35
votes
3 answers

How to get user's username in v2.0 or later of Facebook's Graph API

I used to get the user's username in the API 1.0 fairly easily, using /me and getting the username property of the response object. Now I'm getting this error with API 2.0: "(#12) username is deprecated for versions v2.0 and higher" The only way I…
joaopribs
  • 648
  • 1
  • 7
  • 13
32
votes
7 answers

Facebook Graph API rejects newly created access token

Earlier today, the Facebook login flow of our web application stopped working for some users. When we try to fetch the current profile, an error is returned. It claims that the access token we just generated by redirecting the user to the OAuth…
Thomas
  • 2,231
  • 1
  • 19
  • 27
25
votes
2 answers

Downside to always using auth_type="rerequest" in Facebook login button (for required permissions)?

I've got a Facebook login implementation (for a website, using the javascript API) for which I want the "email" permission to be required. When the user first logs in, they may deny this permission - which is easy enough to detect by a subsequent…
13
votes
1 answer

How to programmatically invite Facebook friends on a website

The functionality that I need is to show a list of Facebook friends to the user on the website page with custom design, where the user can select some of them and send invites. In API v2.0 it's possible to get a list of friends this…
12
votes
6 answers

Facebook Graph Api 2.1 get userid from username

I am looking for a solution which can provide me user id from profile url or fb username example :http://facebook.com/username get userid of this url and also when I try to read friends (I have friend related permission), I am getting blank…
Dhiraj
  • 1,119
  • 1
  • 13
  • 23
10
votes
1 answer

The appropriate usage of the API : `/me/taggable_friends`

With v2.0 in effect, the API /me/friends is now limited to the list of friends that have authorized our app. So, this wont help if I need the complete list of my friends. But facebook also have added a new API /me/taggable_friends that we can use in…
Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
10
votes
5 answers

Facebook graph API always returns small pictures

I'm using facebook graph api, and I issue this command /V2.0/me/home it returns something like : "id": "xxxxxxxxxxxxxxxxxxxxxx", "from": { "id": "xxxxxxxxxxxxxxxxx", "name": "Roger" }, "story": "Roger shared a link.", …
N S
  • 303
  • 4
  • 17
9
votes
1 answer

Would FB deprecate the X-FACEBOOK-PLATFORM authentication method for its Chat API

Today, Facebook announces its Graph API v2.0 - https://developers.facebook.com/docs/apps/changelog. One permission xmpp_login is no longer available in the new version according to the change log. This permission is critical in order to generate an…
Roger Jin
  • 553
  • 5
  • 15
8
votes
3 answers

Facebook login for group members

I'm the administrator of a small group on Facebook, it has about 40-50 members. Now I'm building a webpage for the group which will authorize users using Facebook Login (I'm using Laravel + SammyK's LaravelFacebookSDK if that matters). Everything…
nxu
  • 2,202
  • 1
  • 22
  • 34
8
votes
0 answers

How can I get the poll results using Facebook Graph-API v2.0?

I'm interested to get the poll result from a question I had created on my Facebook profile. Looking for a solution in the documentation: https://developers.facebook.com/docs/graph-api/reference/v2.0/question I read that the feature 'Question' is…
1
2 3
17 18