[英]Facebook Graph API. How to get comment from post
嗨,我有這個可以從帖子中獲得評論它有效是有幾年的
$json = file_get_contents("http://graph.facebook.com/730350233684840/comments?limit=2500");
echo $json;
但現在我在 facebook 上有這個錯誤
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104
}
}
我如何從帖子中獲得所有評論?
我使用你的代碼@luschn 我的請求和真正的應用程序 ID 和應用程序秘密
https://graph.facebook.com/730350233684840/comments?limit=2500&access_token=[APPIS|APPSECRT]
我有這個
{
"error": {
"message": "Invalid OAuth access token signature.",
"type": "OAuthException",
"code": 190
}
}
我使用 chrome 來查看這個錯誤
-- 英語不是我的母語,如有錯誤請見諒。
例如:
$json = file_get_contents("http://graph.facebook.com/730350233684840/comments?limit=2500&access_token=[your-access-token]");
最基本的訪問令牌是一個應用程序訪問令牌,你可以像這樣創建一個:
$appAccesstoken = $appId . '|' . $appSecret;
根據資源,您可能需要用戶或頁面令牌。 為此,您必須授權用戶,這會變得更加復雜。
有關訪問令牌的更多信息:
您必須更改位置訪問令牌和限制
https://graph.facebook.com/167416583311544_730350233684840/comments?access_token=appId|appSecret&limit=2500
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.