Get gender and locale with Facebook Graph API V. 2 - facebook-graph-api

With Facebook Graph API V. 1 I could get the gender and locale of any user with a call to /{userId}.
With Version 2 of the graph API these fields don't get returned, even with (the now obligatory) access token.
I didn't found any notice about this in the API Changelog. So is there still a possibility to get the gender+locale of any user with V. 2?

According to the v2.0 documentation for the User object gender and locale fields should both exist and are considered part of the Core API -
If you're not able to fetch those fields with a user access token for that user, it's likely a bug, but it should work OK in both versions
If you're trying to fetch that data for users that don't use your app, that's unsupported as the primary changes in v2.0 are to apps' ability to fetch data about people who don't use the app

see here https://developers.facebook.com/docs/facebook-login/permissions
gender & locale can only be accessed if:
The person queried is the person using the app. The person queried is
using the app, and is a friend of the person using the app. The person
queried is using the app, is not a friend of the person using the app,
but the app includes either an app access token or an appsecret_proof
argument with the call.

Related

How to fetch a list of Facebook groups that a user administers after new API changes?

Our app has been approved for Groups API as well as publish_to_groups API.
Earlier, Facebook let you get groups that a given user administered. However, administer field is deprecated in the latest API.
How can we fetch it now?
I finally found how to do it. Earlier, Facebook allowed you to pass a filter with ?administrator=1 GET parameter. However, they still have an undocumented field administrator that you can fetch via ?field=administrator GET parameter. It will let you know if you are an admin or not and you can use it from there.

Accessing user_ID via messenger bot

I'm using the Graph API, but I can't figure out how to get a logged-in users ID address.
The intro to Graph states "The Graph API can provide access to all of the basic account registration data you would typically request in a sign-up form for your site, including name, email address, profile picture, and birthday" but to access them i need user_ID so how could i get it ?
https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Did%2Cname&version=v3.0
You need to have a token from the user, check out the given link. You can see what informations you can access if you give permission to your own profile.
This ID is unique to each app and cannot be used across different apps.

Facebook Graph: Match friends

I am trying to see if two facebook users are friends. I could've used graph api .../user1/friends/user2 but instead of actual user ids I have scoped ids (facebook js sdk returns scoped ids). So how can I use user scoped ids to see if they are friends using Facebook js sdk?
Thanks all
This should still work with App Scoped IDs: /me/friends/[app-scoped-id]
It also works with two different App Scoped IDs: /[id1]/friends/[id2]
I just tried it with v2.5 of the Graph API in the API Explorer and got the friend with the App Scoped ID. If it returns nothing, the users are no friends - or they did not authorize your App with the user_friends permission.
Of course both users must have authorized your App for this, for privacy reasons.

How can I get the name of my app reliably from the Facebook Marketing Api

I am trying to retrieve my app campaigns and their associated apps with their events via my advertiser account.
The problem is that I am unable to find a unique identifier for my app in the API response.
For example the query below will get me the 'action_target_id'. This would either equal my AppId or another numeric string which I don't know what is. I am confused, does it mean I have two AppIds?
act_<AD_ACCOUNT_ID>/reportstats?time_interval={"day_start":{"day":"01","month":"03","year":"2014"},"day_stop":{"day":"07","month":"04","year":"2015"}}&data_columns=['adgroup_id', 'actions','action_target_id','action_target_name','campaign_name']&actions_group_by=['action_device','action_type']&format=json&async=true
What are 'action_target_id' and 'action_target_name' meant to represent (in the context of running a campaign for a mobile app)? I cannot seem to find a clear explanation for this in the API doc.
The applications/developer edge will return applications your account has access to.
As for your second question, the action_target_id and action_target_name are not always your application. It depends on what the action specs of each campaign is, if even set. An 'action spec' is a FB format for defining relationships between an ad and various objects for various purposes. More about that at https://developers.facebook.com/docs/marketing-api/intro-action-specs
In your case, the action spec in the context of a mobile app ad campaign will probably be the FB application. See also default conversion spec and default tracking spec.

With Google Apps Admin SDK Directory API, how can I get authenticated user id?

I have an authenticated user and am able to query for a list of domain users using the google apis php client library.
However, it is unclear to me how I can retrieve the currently logged in user's user id. I tried using the my_customer alias which works for the list method, but when I try to do the plain GET request with user key as my_customer, it of course fails.
I know this must be something quite simple, but I cannot for the life of me find an answer in the documentation, so I'm pretty much reduced to guessing at this point.
For your app to work as Google Apps marketplace app, you must implement authentication using OAUTH2.
As a result you must have access to one of the following scopes which provide the APIs that get you the user Id :
https://www.googleapis.com/auth/userinfo.profile (deprecated) : Gain read-only access to basic profile information, including a user identifier, name, profile photo, profile URL, country, language, timezone, and birthdate.
https://www.googleapis.com/auth/plus.login : If using the userId value "me", this method requires authentication using a token that has been granted the OAuth scope https://www.googleapis.com/auth/plus.login or https://www.googleapis.com/auth/plus.me.