【发布时间】:2020-03-11 13:12:35
【问题描述】:
我正在开发一个与用户 Facebook 帐户同步并获取 Facebook 页面信息的应用程序。最初,应用程序要求使用 Facebook 登录并获取页面列表。获取页面后,我调用 API 来获取与每个页面关联的帖子。获得帖子详细信息后,我将调用洞察 API 以获取对每个帖子的洞察。 此流程在开发模式下工作正常,但当我切换到实时模式时,我收到以下错误
Client error: `GET https://graph.facebook.com/v4.0/100575944711552/feed` resulted in a `400 Bad Request` response:{"error":{"message":"(#100) Pages Public Content Access requires either app secret proof or an app token","type":"OAuthE (truncated...)
{"userId":1,"email":"superuser@corals.io","exception":"[object] (GuzzleHttp\\Exception\\ClientException(code: 400): Client error: `GET https://graph.facebook.com/v4.0/100575944711552/feed` resulted in a `400 Bad Request` response:
{\"error\":{\"message\":\"(#100) Pages Public Content Access requires either app secret proof or an app token\",\"type\":\"OAuthE (truncated...)
根据我观察到的详细信息,我在使用时遇到此错误,
GET /v5.0/{page-id}/feed HTTP/1.1
Host: graph.facebook.com
这个端点。我目前有 2 个权限被批准,
- manage_pages 2. read_insights 并且应用审查团队拒绝了 2 个权限,称请求无效,对于这个用例,我们不需要这些权限, 1.Page Mentions 2.user_posts
谁能帮我理解具体的问题是什么?
【问题讨论】:
-
在将应用程序置于实时模式之后,您是否真的以页面管理员用户的身份授予权限?您使用的是什么类型的令牌?
-
是的,页面有管理员权限。我根据要求使用了两种类型的令牌页面访问令牌和用户访问令牌,但是对于页面我们收到错误我正在使用用户访问令牌。
-
您应该使用页面令牌,作为页面发布。
-
某些 API 调用需要
appsecret_proof以及所有相关权限。请参阅他们的 Securing Requests 文档。
标签: facebook api facebook-graph-api facebook-php-sdk