/{conversation-id}
/messages
用戶與 Facebook 專頁或 Instagram 專業帳戶之間的對話訊息。
GET /v21.0/{conversation-id}/messages 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(
'/{conversation-id}/messages',
'{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(
"/{conversation-id}/messages",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{conversation-id}/messages",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{conversation-id}/messages"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
MESSAGING
任務的用戶所要求獲取的專頁存取憑證instagram_manage_messages
權限傳回含有其他欄位的訊息物件陣列:
名稱 | 說明 | 類型 |
---|---|
向量 | 向量 |
您無法向此端點傳送訊息。請改為使用傳送 API。
您無法刪除此端點。