This question already has answers here:
Facebook JS SDK's FB.api('/me') method doesn't return the fields I expect in Graph API v2.4+
(4 answers)
Closed 6 years ago.
So I want to use the api but when I use /{event-id}/feed
I get the follwing:
* message
* date
* id
But what I also like is the name of the user who posted the message. How can I achieve this?
The API-References says that you get An array of Post objects as result.
These Post objects contain detailed information about the message.
For example the field "from": Information about the profile that posted the message.
If the creator of the message is a normal user, from will contain an User object. This object contains the fields first_name and last_name.
Related
I have tried the following url
https://graph.facebook.com/v6.0/{commentid}/comments?access_token={pagetoken}
The result i got was 3 fields: created_time, message, id.
I need value of "from" field. please help me.
By default, you only get a minimum set of fields. You need specify additional fields in the API call:
/{commentid}/comments?fields=field1,field2&access_token={pagetoken}
This question already has answers here:
Facebook JS SDK's FB.api('/me') method doesn't return the fields I expect in Graph API v2.4+
(4 answers)
Closed 6 years ago.
I'm trying to get my information with the Graph API node "me" using the Graph API Explorer to make some tests.
If I use the version v2.5(latest) only "id" and "name" fields are retrieved.
But if I use the v2.3 or earlier versions, more information like "birthday", "first_name", "gender", "last_name" are retrieved.
I need all information like older version but want to use the latest one. What must I do different?
It is called "Declarative Fields" and came with v2.4. You now have to specify the fields you want to get, or you will only get the id and name:
/me?fields=name,first_name,last_name,birthday
Of course you have to authorize the user with user_birthday to get his birthday.
Changelog: https://developers.facebook.com/docs/apps/changelog#v2_4
Since Facebook's Graph API changed to version 2.4, I find that any query attempting to retrieve posts made returns an error:
type: OAuthException, code: 1, message: An unknown error has occurred. [HTTP 500]
My request code uses Facebook's koala ruby api to make requests:
posts = #graph.get_object(appid+"/posts?limit=20",api_version: "v2.3")
I added the version count now, based on koala's recommendation, but the result for this is still the same error that I got without specifying the version. My access token is definitely valid, does anyone know if something else has changed or if this is a bug?
Extending #Tobi 's comment. You have to pass a page/event/user/group id to retrieve the post.
Also, you've to explicitly pass fields parameter to query additional data of a post. So your query will become:
posts = #graph.get_object(id+"/posts?fields=id,name,message,picture&limit=20",api_version: "v2.4")
Please refer to this document of Facebook Developers to learn more about /postsedge.
This question already has an answer here:
Removing the 'code' parameter from URL - Facebook connect PHP
(1 answer)
Closed 8 years ago.
I'm using Facebook authentification in my web app.
I have a URL of the type : https://www.facebook.com/dialog/oauth?client_id=123456789&redirect_uri=http://myapp.com/#story
It works really well but when the user is redirected to it, there's a query parameter that's added (for ex : http://myapp.com?code=AQCkHq--XXTngRCMgQxAAHExCaWzw5XYadd8vaVMytX91aPEc74oQWMBlyrr_HQUjBcC53sf_bREFz5cOBaFdgfvHSpWk1W0abbQA9ncbc0KQ0vyH6B1H37WXv1wcejblMQ6cTVLS98f4xvz-keiPgDJSh1v-Cyw-ACUFvAvs2yusHaSnfjITVZLDWQnNhBwpoELWFlJ75WAl0OrwD1_snZkQ2QQfL_5rcG2ZmpI9ORmFtFW-mrWEouA1zOiPSyTbP2d2LajGz82_KJuV5LBaFkULZ4mYSdALphPjvfwJkhrSQy7n_xKXGOfgr056bkqOIA#story;id=219012)
Is there a way to remove that long string from the URL?
It seems that when you add the response_type=token parameter, it's gone. ;-)
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>