As part of the V3.3 changes the read_page_mailboxes permission was deprecated. Use pages_messaging permission to access this endpoint.
The read_page_mailboxes permission will stop working after June 30 2020
Shared items in a message. This is a Pages-only endpoint.
GET /v23.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
}];
Permissions
This edge requires a Page access token with the following permissions:
pages_messaging
Apps in Development Mode, are restricted to message people that have a role in the app.
Fields
Name
Description
Type
description
The description of the shared item.
string
link
The URL to the shared item.
string
id
The shared item ID.
string
name
The title of the shared item.
string
template
The object of the shared item.
Object
template.payload.product.elements
This will only be available if the business can view the product. For products that are not owned by the business, it will return shares.data.name as Attachment Unavailable.