/{page-id}
/milestones
The milestones posted by a Facebook Page.
GET /v21.0/{page-id}/milestones 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(
'/{page-id}/milestones',
'{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(
"/{page-id}/milestones",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/milestones",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/milestones"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
An array of Milestone objects.
You can create Page milestones by using this edge:
POST /v21.0/{page-id}/milestones HTTP/1.1
Host: graph.facebook.com
title=Final+Episode+Aired&description=The+big+finale+was+today%21&start_time=2013-09-29T21%3A00%3A00%2B0500
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/{page-id}/milestones',
array (
'title' => 'Final Episode Aired',
'description' => 'The big finale was today!',
'start_time' => '2013-09-29T21:00:00+0500',
),
'{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(
"/{page-id}/milestones",
"POST",
{
"title": "Final Episode Aired",
"description": "The big finale was today!",
"start_time": "2013-09-29T21:00:00+0500"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("title", "Final Episode Aired");
params.putString("description", "The big finale was today!");
params.putString("start_time", "2013-09-29T21:00:00+0500");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/milestones",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"title": @"Final Episode Aired",
@"description": @"The big finale was today!",
@"start_time": @"2013-09-29T21:00:00+0500",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/milestones"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Name | Description | Type |
---|---|---|
| The title of the milestone. |
|
| The description of the milestone. |
|
| The start time of the milestone. This will also be used for the |
|
If successful:
Name | Description | Type |
---|---|---|
| The newly created milestone ID |
|
You can't delete using this edge, however you can delete milestones using the /{milestone-id} node.
You can't update using this edge, however you can update milestones using the /{milestone-id} node.