There is no way to get this information using the Graph API. The user object of the graph API contains keys for work
and education
, but these are distinct from the user's network affiliations, which cannot be accessed via the Graph API.
What you need to do instead is use FQL. You can get the user's network affiliations using the affiliations
column of the user table. If that's really what you want to do, then that's all you need to know.
However, if (as seems likely) you're not strictly interested in the user's network affiliations, but are instead more broadly interested in their education history, beware! As mentioned, affiliations
are distinct from work
and education
in Facebook's data. There is no guarantee that a user who has entered a particular High School or University into the 'Education' section of their profile has also joined the network for that school or university... but they may have. Worse, if someone has, for example, both added a university to their education section and also joined that university's network, the university may appear under different names in the 'network' column and the 'education' column. This means that getting a complete list without duplicates of the schools or universities somebody has attended is non-trivial and will require some clever hacks on your end.
For example, when selecting affiliations
and education
from the user table, one of my friends shows up like this:
"affiliations": [
{
"nid": 16777585,
"name": "Oxford University",
"type": "college"
},
{
"nid": 33585181,
"name": "Queens College, Taunton",
"type": "high school"
}
],
"education": [
{
"school": {
"id": 110611448960664,
"name": "Queens College, Taunton"
},
"type": "High School"
},
{
"school": {
"id": 16686610106,
"name": "University of Oxford"
},
"type": "College"
}
]
Note that her education section includes 'University of Oxford', but in her affiliations, it's 'Oxford University'. If you want to be able to pull a user's education history cleanly, you'll need to do something clever to identify that these are duplicates on your end.
To get an idea of the mess you face, run this query to see the 'education' and 'affiliations' fields of all your friends.
Good luck!