As of April 4, 2018, this node no longer returns information. Please see the changelog for more information.
/{achievement-id}
Represents a user gaining an achievement in a Facebook game. Not to be confused with an achievement type.
GET /v2.12/{achievement-id} 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(
'/{achievement-id}',
'{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(
"/{achievement-id}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{achievement-id}",
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:@"/{achievement-id}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
user_games_activity
permission, for any achievements that person has made in any app. Name | Description | Type |
---|---|---|
| ID of this particular achievement. |
|
| The user who achieved this. | |
| Time at which this was achieved. |
|
| The app in which the user achieved this. | |
Vector | Vector | Vector |
| Always |
|
| Indicates whether gaining the achievement published a feed story for the user. |
|
You can publish achievements by using the /{user-id}/achievements
edge.
You can delete achievements by using the /{user-id}/achievements
edge.