我正在使用this solution从用户的供稿中选择单个帖子。
我在最新版本5.7上使用PHP Facebook SDK。
以前这没问题,我提出了这样的要求:
$response = $this->fb->get(
'/'.$user['id']. '_' .$post_id.'/?fields=id,description,name,full_picture',
$this->get_access_token()
);
我会得到所有领域。但是,在过去的几个月中,这已停止工作。
access_token
请求以下权限:
['user_events', 'user_posts']
我找不到Stack Overflow post中概述的解决方案的任何文档。因此,我不确定是否需要更多权限。
发送此请求时我没有收到错误,我只是获得了ID,没有别的。可以在Graph API Explorer中确认:
v5.0 docs显示,当请求帖子时,我可以得到full_picture
,name
和description
,而无需提及所需的任何其他权限。
但是该页面建议仅使用帖子ID进行请求:
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{post-id}',
'{access-token}'
);
}
[这不起作用,您
{
"error": {
"message": "(#12) singular statuses API is deprecated for versions v2.4 and higher",
"type": "OAuthException",
"code": 12,
"fbtrace_id": "ACs2rpwobcW8zSFyL_0Q2yQ"
}
}
错误的确提到了statuses
而不是posts
,但我不确定如何区分两者之间的区别,我认为它们是相同的。
还有其他人偶然发现此问题并找到了解决方案吗?