그래프 API 버전

그래프 API 참고 자료 /{message-id}/shares

V3.3 변경 사항의 일부로 read_page_mailboxes 권한이 사용 중단됩니다. 이 엔드포인트에 액세스하려면 pages_messaging 권한을 사용하세요. 2020년 6월 30일 이후에는 read_page_mailboxes 권한이 사용 중단됩니다.

메시지의 공유 항목입니다. 이는 페이지 전용 엔드포인트입니다.

읽기

그래프 API 탐색기
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.nameAttachment Unavailable로 반환합니다.

속성 유형 설명

id

문자열

Facebook 제품 카탈로그의 제품 ID

retailer_id

문자열

제품과 연결된 외부 ID(예: SKU/콘텐츠 ID)

image_url

문자열

제품 이미지의 URL

title

문자열

제품 제목

price

문자열

제품 가격

제품 템플릿의 예시

대화 API의 제품 템플릿은 그래프 API v8.0 이상에서만 사용할 수 있습니다.

대화 API에서 제품 상세 정보를 받으려면 앱은 catalog_management 권한을 승인받아야 합니다.

"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"
                            },
                            {..}],
                        }
                    }
                }
            }
    }]
}    

게시

이 에지를 사용하여 게시할 수 없습니다.

삭제

이 에지를 사용하여 삭제할 수 없습니다.

업데이트

이 에지를 사용하여 업데이트할 수 없습니다.