Messenger ID Matching API returns empty data - facebook

I want to get the real facebook id of users that interact with my messenger app using this. When I debug using the graph api explorer I get results if I use my own psid returned by messenger to send a request but if I use the psid of other users it gives me an empty array of data. What may be the cause of the problem?
GET /{my-own-psid}/ids_for_apps - returns a result
GET /{other-users-psid}/ids_for_apps - doesn't give a result

Related

Matching Facebook userID to FirebaseId

Currently I am using facbook as my provider to log in to firebase.
The uid I get from that I save.
Next I make a call to the Facebook Graph api to retrieve a list of friends who use the current app.
I also get an id with this call but they do not match with the uid I get at login.
I would need a way to map my firebase users logged in with facebook to the friend list I get from the graph api.
I feel like I'm missing something obvious but I can't seem to find it.

og.follows facebook api returns null

I am trying to get a list of followers who are my friends or facebook pages I like. Facebook API lists og.follows as the way to access this data but despite giving all permissions in the access token, I get empty data screenshot here

Fetching activity feeds of all the users together in a request

I have a facebook application which posts on users activity feed as soon as the user uses my website. I am also trying to show the activity of users' friend on my website. For this , I am fetching back the feeds being posted by my application on facebook for his friends.
However, the problem is , in the first request , I am getting the list of all the friends of the respective user who have installed my application. Once, I get this list, I am able to get his friends, however, only one at a time.
So, if a user has 50 of his friends using my website, it will take 50 request to show him his friends activity. Is there a way in facebook open graph to fetch the list of all feeds of all friends together, or, using least number of requests ?
Please suggest some ways to do the same.
If you are using FQL to grab the data, you can use WHERE uid IN (…,…,…) to select data for more than one user at once.
And with FQL you can do multi-queries, or using the API you can do batch requests; to reduce the number of HTTP requests necessary to get the data.

How to get facebook friends list with hometown using Graph API?

I know you can get friends list using this url:
https://graph.facebook.com/me/friends?access_token=XXX
But what I see there is a list of friends with ids and names, but I need hometown on this list. I requested friends_hometown permission, and when I run this url:
https://graph.facebook.com/100001986459077?access_token=XXX
then it works ok - I see hometown among all the fields.
But I don't want to call second URL for all the friends (too many times). I would like to get it in one call using first URL. Is there a way to achieve this target?
Notice: I'm not interested in FQL solution as I know it. All I need is graph API valid url to perform this action.
https://graph.facebook.com/me/friends?fields=id,name,hometown,location&access_token=[access_token_here] will provide you with the list you're wanting.
You will need to ensure the scope for the access token includes the friend's location and hometown in order to retrieve the data for that user's friend data.

How to get the list of friend_request using facebook API

How to get the list of friend_request using facebook API.
For example, user A,has logged in.
Use B send request of adding friends to A
Now, I want to get the friend_request of user A, how to do?
May the facebook graph API could not support the operate, yes or not?
At the same time, I would like to use FQL as below,
SELECT uid_from FROM friend_request WHERE uid_to=204686
(http://developers.facebook.com/docs/reference/fql/friend_request)
But, how to send the FQL to facebook server?which url?
like this:https://api.facebook.com/method/fql.query?query=select .... &access_token=....format=json... yes or not?
any other idea?
Thank you!
Simon
If you are using Java then why not use one of available Java Facebook APIs? Let API worry about which request to send where. Currently I am using RestFB API, there are plenty of examples on their site including how to execute FQL.
UPDATE
Ok, if you have to send requests manually then sending them using URL you provided is correct. Just remember that you would need to encode your FQL query before sending it as a param (URLEncoder in java would do the trick). You can play with the queries on this page and it will show you how your request should look like and what is returned.