如何克服以编程方式发布到我的 Facebook 页面时新出现的 #200 错误?

How to overcome the newly arised #200 error while posting to my Facebook page programatically?

两年来,我一直在使用 PHP SDK post 访问我的 Facebook 页面。今天我遇到了这个错误:

(#200) Requires either publish_to_groups permission and app being installed in the group, or manage_pages and publish_pages as an admin with sufficient administrative permission

我没有更改任何内容,据我所知,当我只需要 post 我拥有的页面时不需要这些权限。

我使用 PHP SDK v.5.5.0。这是我的代码:

$fb = new Facebook\Facebook([
  'app_id' => 'MY_APP_ID',
  'app_secret' => 'MY_APP_SECRET',
  'default_graph_version' => 'v2.9',
  'default_access_token' => 'MY_NEVER_EXPIRING_TOKEN'
]);

$linkData = [
  'link' => 'http://example.com',
  'message' => 'Message',
  'description' => 'Description',
  'caption' => "Caption",
];

try {
  $response = $fb->post('/MY_PAGE_ID/feed', $linkData);
  $graphNode = $response->getGraphNode();
  echo 'Posted with id: ' . $graphNode['id'];
  $status = 1;
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getRawResponse() . 
  $status = -1;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage() . 
  $status = -1;
}

如果我不更改代码中的任何内容,有什么可能会破坏的想法吗?非常感谢。

这是一个错误,已在此处报告:https://developers.facebook.com/bugs/331730207440499/ 并迅速被 Facebook 修复。有些权限好像被误撤销了,后来又恢复了。