/{message-id} /sharesv3.3の変更の一環として、read_page_mailboxesアクセス許可は廃止されました。このエンドポイントにアクセスするには、pages_messagingアクセス許可を使用してください。read_page_mailboxesアクセス許可は、2020年6月30日を過ぎると使用できなくなります
メッセージ内の共有アイテム。これはページ専用のエンドポイントです。
GET /v24.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開発モードのアプリは、アプリでの役割を持つユーザーにのみメッセージを送信できます。
| 名前 | 説明 | 型 |
|---|---|---|
| 共有アイテムの説明。 |
|
| 共有アイテムのURL。 |
|
| 共有アイテムのID。 |
|
| 共有アイテムのタイトル。 |
|
| 共有アイテムのオブジェクト。 |
|
template.payload.product.elementsこれは、ビジネスが商品を表示できる場合にのみ利用できます。ビジネスが所有していない商品については、shares.data.nameがAttachment Unavailableとして返されます。
| プロパティ | 型 | 説明 |
|---|---|---|
| 文字列 | Facebook商品カタログの商品ID |
| 文字列 | 商品に関連付けられている外部ID。(例: SKU/コンテンツID) |
| 文字列 | 商品画像のURL |
| 文字列 | 商品のタイトル |
| 文字列 | 商品の価格 |
会話APIの商品テンプレートは、グラフAPI v8.0以上でのみ利用できます
アプリがWebhooksで商品の詳細情報を受け取るためには、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ドル"
},
{..}],
}
}
}
}
}]
} このエッジを使って公開することはできません。
このエッジを使って削除することはできません。
このエッジを使ってコメントを更新することはできません。