0
votes

Is there a way to get friends with relationship_status equals Married using Graph API? I did it using FQL, but some fields aren't equals and I have problems using RestFB with these fields like birthday which have different behaviors using Graph API and FQL.

FQL code do get married friends SELECT uid, name, relationship_status FROM user WHERE (uid = MY_ID OR uid IN (SELECT uid2 FROM friend WHERE uid1 = MY_ID)) AND relationship_status='Married'

I wanna to do the same with Graph API

Graph API is more clean I think too.

Thanks

2

2 Answers

1
votes

You have the exact query to get all married friends.

Just you have to do is call this FQL query using GRAPH API.

See the following blog for more details on how to call an FQL using GRAPH API.

http://developers.facebook.com/blog/post/579/

Also please read my answer to this question to just to fix any possible errors when using 'file_get_contents' in your code (as in the example of the FB blog post)

1
votes

try this.. https://graph.facebook.com/fql?q=SELECT uid, name, relationship_status FROM user WHERE (uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())) AND relationship_status='Married'.