Reputation: 21828
If my Facebook app knows that an app user (FB ID = foo) has sent an app request (request ID = bar) to another FB user (user2), is there a way to find the FB ID of user2?
Upvotes: 0
Views: 229
Reputation: 25918
In general this should be available prior to authentication of user2.
But there is some edge case:
If this is a request which involves only one recipient, you know the id
of that request (it's passed to your canvas once user accepting it in request_ids
URL argument) and don't mind using application's access_token
this is pretty easy.
Just get the details of request from Graph API:
https://graph.facebook.com/REQUEST_ID?access_token=APPLICATION_ACCESS_TOKEN
Result will include all the request details including recipients list.
Beware, this method allow you to know to whom request was sent but it's not allow you to ensure that visitor is the same person (it takes nothing to fake request accept if someone know request id
).
BTW, APPLICATION_ACCESS_TOKEN
may be either one described in Authenticating as an App or an older APP_ID|APP_SECRET
format...
Upvotes: 1