Facebook documentation states that public_profile is enabled by default and, among the details allowed to retrieve from there, there is age_range.
I'm trying to retrieve such field using the Facebook app token. I can retrieve name, first_name, last_name, picture, etc... with the app access token. But when I specify the age_range in the fields query param of the request, age_range is not returned:
curl -i 'https://graph.facebook.com/<user_facebook_id>?access_token=<app-access-token>&fields=picture,age_range'
then I get
{"picture":{"data":{"height":50,"is_silhouette":false,"url":"https:\/\/lookaside.facebook.com\/platform\/profilepic\/?asid=<user-facebook-id>&height=50&width=50","width":50}},"id":"<user-facebook-id>"}
Is age_range exposed only when the graph is accessed via the /me path and user Facebook access token?
I've asked Facebook support and they confirmed that field is not accessible via the app token.
Related
What are user fields publicly accessible through Facebook Graph Api (using an user access token or an app access token)? I mean not the logged in user.
So a call like this
GET /v2.7/{user-id} HTTP/1.1
Host: graph.facebook.com
where user-id is not me
Witout authorization, no data at all can be read from a user. You MUST authorize the user, and you can just use /me with the User Access Token.
If a user IS authorized, it depends on the permissions. Some data needs additional permissions, without additional ones you only get stuff like id, name, first_name, last_name, age_range, picture, ...
A list of available fields can be found in the API reference: https://developers.facebook.com/docs/graph-api/reference/user
I'm looking to run some data analysis on the users of my Facebook application. I don't have their user access tokens stored on the server so I am planning on using my app access token to pull information from the graph API.
By default, calling /{user-id} returns
id
name
first_name
last_name
link
username
location
quotes
favorite_teams
gender
email
locale
languages
The documentation says that the following things are available with an app access token:
Basic Profile Info of a User (ID, Name, Username, Gender)
A User’s Friends and their IDs
Permissions granted by the User to your App
It seems that by default you get more than the basic information. Are there other things you can get with an app access token than the above?
I have noticed that some other fields can be manually added by appending them to ?fields=x in the URL.
Available fields that I've noticed so far are
cover
third_party_id
installed
permissions
picture
I am using facebook login in my iphone app and am accessed some basic details from Facebook API such as name, dob, email , username for user creation. I want to store access token for each user . Need your help in this
You can extend the duration of the access token
https://developers.facebook.com/docs/howtos/login/extending-tokens/
I use the following code:
$access_token = $object->getAccessToken();
This method sometimes generated an access token (118-char string)
and sometimes it's a 49-character string with a pipe symbol which does not work properly.
Can I use same access token to post feed with different user id?
Why do access tokens not work properly in safari with iframe & non iframe?
Is there any link do access token documentation?
Firs of all there are two type of tokens that are generated by Facebook
Application without User
When there is no user using the application the application uses what is known as "App Access Token". The app access token can be represented as
<APP ID>|<APP Secret>
This token can retrieve all the public domain information for different Objects in Facebook, like it can be used to retrieve basic information about a User with specific ID, likes on a Public Page, Public Posts on a Page.
Application with User
When User authorizes the application Facebook generates a "User Access Token" which is the access token with longer length. You can't use User Access Token of one user to do the actions on behalf of another User and if you try the action will be done as the User for whom the token was generated for(If you are not Using Extended Access Token it will also expire).
There is issue in setting the Cookies within an iframe in the safari due to which there is some issues in the application working.
For further clarification on Access Token check this documentation
I have started on developing a server side application that requires integration with facebook. My needs is an access token that will not expire, but unfortunately facebook has removed the offline_access feature and replaced with a long-live user access token that will last only 60 days.
I realise that there is an Application Access Token that will not expire. When I use it instead of the User Access Token to fetch the feed, I get must less information.
I have read from other sources that as long as relevant permissions are delegated, such as read_stream is given, using the application access token should allow the server-side application to access the users information that accepted the facebook application.
Am I mistaken ? Can anyone help to clarify ? Thanks
Thanks
Excerpt from: https://developers.facebook.com/docs/opengraph/using-app-tokens/
While an App Access Token is largely for the purposes of publishing information back to Facebook on behalf of the user, there is a limited set of information that can be retrieved from Facebook using an App Access Token.
Basic Profile Info of a User (ID, Name, Username, Gender)
A User’s Friends and their IDs
Permissions granted by the User to your App
So there is a limited set of info you can get using an app access token. So you probably don't want to use it to get the user's feed.