I created an app in Facebook a while back to get a feed from a specific clients page. The feed looks something like so:
I am trying to do the same with a new client and now the feed looks very different:
What am I doing wrong? Is there something I can do to get the old feed style back, because it gives so much more information than the new API versions feed.
The older app is version 2.0 and the newer one is 2.5.
What you missed is that with all Graph API request above v2.3, you need to specify the fields you want to have returned from the Graph API. Otherwise only a small standard set of fields is returned.
See
https://developers.facebook.com/docs/apps/changelog#v2_4
Declarative Fields
To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.
Related
When I use postman application or Graph API explorer then i get complete information or all fields of posts as explained in https://developers.facebook.com/docs/graph-api/reference/v2.0/post
I have not use fields attribute in above image even then it is showing all fields so i am looking for the answer to pass field attribute in query string.
But when i use SDK i get only 3 fields created_time, id and message, please refer following image:
Kindly tell how to get all fields of the posts using facebook sdk c#?
You need to specify the fields parameter, it´s called "Declarative Fields" and came with v2.4 of the Graph API: /me/posts?fields=field1,field2,field3,...
The possible fields can be found in the docs, you should use the latest version though: https://developers.facebook.com/docs/graph-api/reference/v2.7/post
Make sure you are using a newer Version of the API, you are trying to use v1.0 in Postman (which does not exist anymore).
And application is using facebook sdk to get user newsfeed via client.Get(request_string) where request_string = "/me/home<some_filters>". And I discovered that sdk and api exprorer return different results with the same request string. Why can it happen?
This is similar to this question.
Some posts not visible on the feed through Graph API /me/home
The reason is Facebook "scores" nodes to derive the most "Top Story". Low scoring nodes are by default not visible. You can force all nodes with
/me/home.filter(owner)<some_filters>
There is no documentation on WHY this actually works, but it does. You can also force all nodes that are Likes or Comments by doing the following
me/posts?fields=likes.filter(stream),comments.filter(stream)
related to Open Graph api for feed returning inconsistent results
When I publish a post on a page's feed using my App, facebook returns some id in the form of <page_id>_<post_id>, but when the same App receives a Real time Update from the same page—say a like or a comment—the parent_id field of the like or comment contains only the <post_id> part!
Is this a bug or what?
Here is the response from facebook engineers -
This is by design. For a realtime update generated by a comment, the parent_id will just show and not include the page_id.
For specific examples, please refer to our documentation (https://developers.facebook.com/docs/reference/api/page/#realtime) and look under the sub-sections "Feed Example."
I know it is possible to get the locale of the user with getSignedRequest, and it is possible to get the locale of the user with https://graph.facebook.com/me?fields=locale once they have authorised the app. But what is the equivalent graph api url that I can use before they have authorised the app? All my code is with the graph api so I really dont want to have to switch now to using the whole facebook->getSignedRequest() stuff. I can't find it anywhere but seems silly this functionality has not been provided in graph api?
You have to pick between using the signed_request (which is sent in a POST request to all apps on Facebook) or authorizing the user.
If you don't do one of these, then you won't know what the Users ID is, so you will never be able to identify their locale.
The signed_request just requires you to be able to capture request data and then perform the parsing logic outlined in the doc linked to above - it doesn't require the use of any SDK or API, just the ability to read requests (most languages will be able to do this).
Is it possible to get and to change the new porfile cover (mine or my friends' profil cover) with the sdk php or JS ?
It is possible to get the Facebook's user cover image using the Graph API. You have to add 'fields=cover' to the user request. The response is an array of fields id, source, and offset_y. You need an access token for this.
You cannot update the cover photo using the API, only retrieve it.
http://graph.facebook.com/[USER_ID]?fields=cover
It's still not possible with the current APIs exposed by Facebook.