Graph API Version

User Context Mutual Likes

/{user-id}.context/mutual_likes

A list of the liked Pages that the session user and the request user have in common.

Reading

GET /v2.10/{user-id}?fields=context.fields%28mutual_likes%29 HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{user-id}',
  array (
    'fields' => 'context.fields(mutual_likes)',
  )
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{user-id}",
    {
        "fields": "context.fields(mutual_likes)"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("fields", "context.fields(mutual_likes)");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{user-id}",
    params,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"fields": @"context.fields(mutual_likes)",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{user-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • Both the session user and the request user (the user-id in the Graph call) must have granted user_likes permission to the app.
  • A user access token with the above permission is required.

Fields

An array of Page objects each representing a mutual like, and the following:

NameDescriptionType

summary

Some metadata which summarizes the social context.

object

total_count

The full count of liked Pages in common.

integer

Publishing

You can't publish using this edge.

Deleting

You can't delete using this edge.

Updating

You can't update using this edge.