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

ข้อมูลอ้างอิงเกี่ยวกับ API กราฟ /{message-id}/shares

เราได้เลิกใช้สิทธิ์การอนุญาต read_page_mailboxes แล้ว โดยเป็นส่วนหนึ่งของการเปลี่ยนแปลงในเวอร์ชั่น 3.3 ให้ใช้สิทธิ์ pages_messaging เพื่อเข้าถึงตำแหน่งข้อมูลนี้ โดยสิทธิ์การอนุญาต read_page_mailboxes จะหยุดทำงานหลังจากวันที่ 30 มิถุนายน 2020

รายการที่แชร์ในข้อความ ตำแหน่งข้อมูลนี้มีไว้สำหรับเพจเท่านั้น

การอ่าน

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

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

จุดเชื่อมโยงนี้ต้องใช้โทเค็นการเข้าถึงเพจพร้อมสิทธิ์การอนุญาตต่อไปนี้:

  • pages_messaging

แอพที่อยู่ในโหมดการพัฒนาจะถูกจำกัดให้ส่งข้อความถึงผู้คนที่มีบทบาทในแอพเท่านั้น

ช่อง

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

description

คำอธิบายของรายการที่แชร์

string

link

URL ของรายการที่แชร์

string

id

ID ของรายการที่แชร์

string

name

ชื่อของรายการที่แชร์

string

template

อ็อบเจ็กต์ของรายการที่แชร์

Object

template.payload.product.elements

ใช้งานได้ก็ต่อเมื่อธุรกิจสามารถดูสินค้าได้เท่านั้น ระบบจะส่งคืน shares.data.name เป็น Attachment Unavailable สำหรับสินค้าที่ไม่ได้เป็นของธุรกิจ

คุณสมบัติ ประเภท คำอธิบาย

id

สตริง

ID สินค้าจากแค็ตตาล็อกสินค้าบน Facebook

retailer_id

สตริง

ID ภายนอกที่เชื่อมโยงกับสินค้า (ตัวอย่าง: SKU/ID เนื้อหา)

image_url

สตริง

URL ของรูปภาพสินค้า

title

สตริง

ชื่อของสินค้า

price

สตริง

ราคาของสินค้า

ตัวอย่างของเทมเพลตสินค้า

คุณสามารถใช้เทมเพลตสินค้าบน API การสนทนาได้ใน API กราฟเวอร์ชั่น 8.0 ขึ้นไปเท่านั้น

แอพจะต้องมีสิทธิ์การอนุญาต catalog_management ที่ผ่านการอนุมัติให้รับรายละเอียดสินค้าใน API การสนทนาได้

"shares": {
    "data": [{
       "template": {
            "payload":{
                "product": {
                    "elements":{ // multiple elements in Hscroll
                        "data": [
                            {
                                "id" : "<Product_id>",
                                "retailer_id": "<EXTERNAL_ID>", 
                                "image_url" : "https://fb.cdn.com/sdsd",
                                "name" : "Some product title",
                                "price" : "$10"
                            },
                            {..}],
                        }
                    }
                }
            }
    }]
}    

การเผยแพร่

คุณไม่สามารถเผยแพร่โดยใช้จุดเชื่อมโยงนี้ได้

การลบ

คุณไม่สามารถลบโดยใช้จุดเชื่อมโยงนี้ได้

การอัพเดต

คุณไม่สามารถอัพเดตโดยใช้จุดเชื่อมโยงนี้ได้