/{user-id}
/friendrequests
A person's pending friend requests.
GET /v2.12/me/friendrequests HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/me/friendrequests',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/me/friendrequests",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/me/friendrequests",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/me/friendrequests"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
read_requests
permission is required to view the current person's received friend requests.Name | Description | Type |
---|---|---|
| The person who sent the friend request | |
| The person to whom the friend request was sent. This will always be the current user. | |
| Time at which the friend request was created |
|
| Message provided by the sender when they sent the request |
|
| Whether the user has read the friend request or not. |
|
You can't publish using this edge. The Friends Dialog should be used if you want to integrate the ability to add someone as a friend in your app.
You can't delete using this edge.
You can't update using this edge.