页面 Feed 中缺少 Facebook API "from" 字段
Facebook API "from" field missing in page feed
我正在开发一个需要读取 facebook 页面的 post 的程序。我已经获得了一个永久页面令牌,我可以通过 API 资源管理器中的 "debug_token" 端点 运行 并且可以看到我有一个没有到期的页面令牌 "manage_pages" 和所有相关页面权限:
"data": {
"app_id": "xxxxxxxxxxxxxxxx",
"type": "PAGE",
"application": "Second",
"data_access_expires_at": 1583432075,
"expires_at": 0,
"is_valid": true,
"issued_at": 1575649224,
"profile_id": "yyyyyyyyyyyyyyy",
"scopes": [
"user_events",
"email",
"read_insights",
"manage_pages",
"pages_manage_cta",
"pages_manage_instant_articles",
"pages_show_list",
"publish_pages",
"read_page_mailboxes",
"ads_management",
"ads_read",
"business_management",
"pages_messaging",
"pages_messaging_phone_number",
"pages_messaging_subscriptions",
"publish_to_groups",
"groups_access_member_info",
"public_profile"
],
...
使用相同的标记,我查询 /{page_id}/feed,我得到的响应没有 "from" 字段:
"data": [
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-12-05T20:24:24+0000",
"message": "Bla bla bla"
},
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-11-20T18:17:54+0000",
"message": "Bla bla bla"
}
...
即使我在字段中明确请求 "from",我也没有得到它,API 资源管理器显示左侧的字段变灰,并显示工具提示:"Fields is empty or disallowed by the access token".
显然 "from" 字段不为空,这是不允许的。我知道在大多数情况下这是受保护的信息,但 "feed" 端点文档说
Publicly Identifiable Information - User information will not be in included in responses unless you make the request with a Page access token.
https://developers.facebook.com/docs/graph-api/reference/v5.0/page/feed
因此,此请求是使用页面访问令牌完成的,对于作为这些 post 的接收者的页面。顺便说一句,我正在用另一个普通帐户自己做这些 posts,没有调整权限或隐私选项。希望 post 的来源知道你在和谁说话似乎是合理的,对吧?
我已经搜索并尝试了其他回复,但答案有些陈旧,而且 facebook API 中的规则确实经常更改,所以这是全新的(截至 2019 年 12 月)。
我想补充的最后一点是,此页面和应用程序未与商务经理帐户相关联。根据我的阅读,这对于我正在尝试做的事情来说不是必需的。
谢谢。
Debug infor on token
Missing from field from feed
好的,这是我自己想出来的。希望答案可以帮助处于类似情况的其他人。
问题是我的应用程序具有 "development" 状态,这是正确的。根据 FB 的以下安全文件:
- App users can only access the data of users who have a role on the app.
https://developers.facebook.com/docs/apps/security/
这个额外的保护层使我的应用程序甚至无法看到谁在其关联页面上直接发帖。
我在应用程序中为发帖帐户赋予了 "tester" 角色,现在响应具有预期的发件人字段:
"data": [
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-12-05T20:24:24+0000",
"from": {
"name": "Poster Name",
"id": "zzzzzzzzzzzzzzz"
},
"message": "Bla bla bla"
},
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-11-20T18:17:54+0000",
"from": {
"name": "Poster Name",
"id": "zzzzzzzzzzzzzzz"
},
"message": "Bla bla bla"
}
...
我正在开发一个需要读取 facebook 页面的 post 的程序。我已经获得了一个永久页面令牌,我可以通过 API 资源管理器中的 "debug_token" 端点 运行 并且可以看到我有一个没有到期的页面令牌 "manage_pages" 和所有相关页面权限:
"data": {
"app_id": "xxxxxxxxxxxxxxxx",
"type": "PAGE",
"application": "Second",
"data_access_expires_at": 1583432075,
"expires_at": 0,
"is_valid": true,
"issued_at": 1575649224,
"profile_id": "yyyyyyyyyyyyyyy",
"scopes": [
"user_events",
"email",
"read_insights",
"manage_pages",
"pages_manage_cta",
"pages_manage_instant_articles",
"pages_show_list",
"publish_pages",
"read_page_mailboxes",
"ads_management",
"ads_read",
"business_management",
"pages_messaging",
"pages_messaging_phone_number",
"pages_messaging_subscriptions",
"publish_to_groups",
"groups_access_member_info",
"public_profile"
],
...
使用相同的标记,我查询 /{page_id}/feed,我得到的响应没有 "from" 字段:
"data": [
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-12-05T20:24:24+0000",
"message": "Bla bla bla"
},
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-11-20T18:17:54+0000",
"message": "Bla bla bla"
}
...
即使我在字段中明确请求 "from",我也没有得到它,API 资源管理器显示左侧的字段变灰,并显示工具提示:"Fields is empty or disallowed by the access token".
显然 "from" 字段不为空,这是不允许的。我知道在大多数情况下这是受保护的信息,但 "feed" 端点文档说
Publicly Identifiable Information - User information will not be in included in responses unless you make the request with a Page access token.
https://developers.facebook.com/docs/graph-api/reference/v5.0/page/feed
因此,此请求是使用页面访问令牌完成的,对于作为这些 post 的接收者的页面。顺便说一句,我正在用另一个普通帐户自己做这些 posts,没有调整权限或隐私选项。希望 post 的来源知道你在和谁说话似乎是合理的,对吧?
我已经搜索并尝试了其他回复,但答案有些陈旧,而且 facebook API 中的规则确实经常更改,所以这是全新的(截至 2019 年 12 月)。
我想补充的最后一点是,此页面和应用程序未与商务经理帐户相关联。根据我的阅读,这对于我正在尝试做的事情来说不是必需的。
谢谢。
Debug infor on token
Missing from field from feed
好的,这是我自己想出来的。希望答案可以帮助处于类似情况的其他人。
问题是我的应用程序具有 "development" 状态,这是正确的。根据 FB 的以下安全文件:
- App users can only access the data of users who have a role on the app.
https://developers.facebook.com/docs/apps/security/
这个额外的保护层使我的应用程序甚至无法看到谁在其关联页面上直接发帖。
我在应用程序中为发帖帐户赋予了 "tester" 角色,现在响应具有预期的发件人字段:
"data": [
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-12-05T20:24:24+0000",
"from": {
"name": "Poster Name",
"id": "zzzzzzzzzzzzzzz"
},
"message": "Bla bla bla"
},
{
"id": "xxxxxxxxxxxxxxx_yyyyyyyyyyyyyyy",
"created_time": "2019-11-20T18:17:54+0000",
"from": {
"name": "Poster Name",
"id": "zzzzzzzzzzzzzzz"
},
"message": "Bla bla bla"
}
...