Facebook 图 API - 我收到错误 "Missing authorization code"?

Facebook graph API - i recieve the error "Missing authorization code"?

我是 facebook 的新手 api,我遇到了一个奇怪的问题,我真的找不到解决方案。我正在尝试使用以下说明获取访问令牌:

但是当我尝试这样做时:

curl -X GET "https://graph.facebook.com/oauth/access_token?client_id=[ID]&client_secret=[SECRET]&redirect_uri=http://localhost&grant-type=clients_credentials"

即使我在我的代码中这样做也会失败,它也会失败:

    var firstOptions = {
    method: 'GET',
    url: 'https://graph.facebook.com/oauth/access_token?client_id=[ID]&client_secret=[SECRET]&grant-type=client_credentials&redirect_uri=http://localhost',
    json: true,

  };
  request(firstOptions, function (error, response, body) {
    console.log(body);
  });

所以我想知道是否有人可以告诉我在哪里以及如何获得授权码?或者如果我做错了什么。因为 facebook 图片不包含任何授权码..

编辑:

根据建议,我尝试了以下操作:

    var pageOptions={
    method: 'GET',
    url: 'https://graph.facebook.com/[PAGE-ID]/posts?access_token=' + 'ID|SECRET',
    json:true
  };

但随后出现以下错误:

{ message: '(#10) To use \'Page Public Content Access\', your use of this endpoint must be reviewed and approved by Facebook. To submit this \'Page Public Content Access\' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.',

当我使用由访问令牌调试器生成的 access_token 时,不会发生此错误:

https://developers.facebook.com/tools/debug/accesstoken/

{ message: '(#10) To use \'Page Public Content Access\', your use of this endpoint must be reviewed and approved by Facebook. To submit this \'Page Public Content Access\' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.',

this error does not occure when i use an access_token generated by the Access Token Debugger

您只是在此处使用了错误类型的访问令牌。

要访问任意 public 页面的内容,您的应用需要先通过 Facebook 审核。

它适用于您在调试工具中生成的令牌,因为这是一个 user 令牌,并且您在相关页面上具有管理员角色 - 这意味着这不是一般访问权限不再只是“public”数据,而是访问您实际上具有管理员访问权限的内容。使用 app 访问令牌,API 无法检查它。

对于此类请求,您需要使用页面管理员 用户 令牌或 页面 令牌。