เวอร์ชันของ API กราฟ

เหตุการณ์สำคัญ /{milestone-id}

หมายถึงเหตุการณ์สำคัญบนเพจ Facebook

คำแนะนำที่เกี่ยวข้อง

การอ่าน

Graph API Explorer
GET /v19.0/{milestone-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(
    '/{milestone-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(
    "/{milestone-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{milestone-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{milestone-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

สิทธิ์การอนุญาต

หากต้องการดูเหตุการณ์สำคัญของเพจใดๆ ที่แชร์เป็นสาธารณะ คุณจะต้องใช้รายการดังต่อไปนี้

หากต้องการดูเหตุการณ์สำคัญของเพจที่คุณจัดการ คุณจะต้องใช้รายการดังต่อไปนี้

ช่อง

ชื่อ คำอธิบาย ประเภท

id

ID งานกิจกรรมของเหตุการณ์สำคัญ

string

title

ชื่อเหตุการณ์สำคัญ

string

from

เพจที่โพสต์เหตุการณ์สำคัญ

Page

description

คำอธิบายเหตุการณ์สำคัญ

string

created_time

เวลาที่สร้างเหตุการณ์สำคัญ

datetime

updated_time

เวลาที่อัพเดตเหตุการณ์สำคัญ

datetime

start_time

เวลาที่เริ่มต้นเหตุการณ์สำคัญ

datetime

end_time

เวลาที่สิ้นสุดเหตุการณ์สำคัญ ซึ่งเหตุการณ์สำคัญของเพจจะมีเวลาเริ่มต้นและเวลาสิ้นสุดเดียวกัน

datetime

การสร้าง

คุณไม่สามารถดำเนินการนี้กับตำแหน่งข้อมูลนี้ได้

โปรดใช้ตำแหน่งข้อมูล /{page-id}/milestones เพื่อสร้างเหตุการณ์สำคัญใหม่สำหรับเพจ

การลบ

สิทธิ์การอนุญาต

หากต้องการลบเหตุการณ์สำคัญของเพจที่คุณจัดการ คุณจะต้องใช้รายการดังต่อไปนี้

DELETE /v19.0/{milestone-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->delete(
    '/{milestone-id}',
    array (),
    '{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(
    "/{milestone-id}",
    "DELETE",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{milestone-id}",
    null,
    HttpMethod.DELETE,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{milestone-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

ช่อง

ไม่จำเป็นต้องลบช่องใดๆ

การตอบกลับ

หากสำเร็จ การแสดงผลจะเป็นดังนี้

{
  "success": true
}

หากไม่เป็นเช่นนั้น ระบบจะส่งคืนข้อความแสดงข้อผิดพลาดที่เกี่ยวข้อง

การอัพเดต

สิทธิ์การอนุญาต

คุณไม่สามารถดำเนินการนี้กับตำแหน่งข้อมูลนี้ได้

จุดเชื่อมโยง

ชื่อ คำอธิบาย

/likes

รายการที่ถูกใจ

/comments

รายการที่แสดงความคิดเห็น