Facebook Graph API:"Feed"不再返回“发件人" (即作者)字段 [英] Facebook Graph API: "Feed" no longer returns "From" (i.e. Author) Field

查看:78
本文介绍了Facebook Graph API:"Feed"不再返回“发件人" (即作者)字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,当使用/feed Facebook Graph API方法时,它已停止返回From字段.此字段通常包含

Recently, when using the /feed Facebook Graph API method, it has stopped returning the From field. This field typically contains the Id and Name of the author of the Facebook Post in question.

我点击的URL是https://graph.facebook.com/{id}/feed?fields={my-fields-here}&access_token={token}

据我所知,From字段仍然存在于API中:如果尝试https://graph.facebook.com/{id}/feed?fields=id,from&access_token={token},我会得到一个ID s列表(尽管没有From),没有错误.

From what I can tell, the From field still exists within the API: If I try https://graph.facebook.com/{id}/feed?fields=id,from&access_token={token} I get a list of IDs (no Froms though), without errors.

但是,如果我尝试使用故意无效的字段名称(例如https://graph.facebook.com/{id}/feed?fields=id,doesnotexist&access_token={token}),则会收到错误响应(#100) Unknown fields: doesnotexist.

However, if I try a deliberately-invalid field name, such as https://graph.facebook.com/{id}/feed?fields=id,doesnotexist&access_token={token} then I get an error response of (#100) Unknown fields: doesnotexist.

因此就Facebook Graph API而言,From字段仍然存在.它不再被退回.最近有什么变化吗? From字段仍在其

So the From field still exists as far as the Facebook Graph API is concerned. It's just no longer being returned. Did something change recently? The From field is also still listed as the list of fields over on their documentation. As far as the data itself goes, posts dating months back also no longer have From, so it's not a case of "newer posts in the feed lack the field, but older posts do either."

我很茫然!如果有人可以伸出援手,我将不胜感激.

I'm at a loss! If anyone could lend a hand, I'd appreciate it.

推荐答案

仅当您使用页面令牌时才包含它. Graph API v2.11(90天的重大更改):

It is only included if you use a Page Token. v2.11 of the Graph API (90-Day Breaking Changes):

/page/*-用户信息将不包含在的GET响应中 页面拥有的任何对象,除非请求是通过 页面访问令牌.这会影响所有返回数据的节点和边 用于页面拥有的对象.

/page/* — User information will not be included in GET responses for any objects owned by (on) a Page unless the request is made with a Page access token. This affects all nodes and edges that return data for objects owned by a Page.

来源: https://developers.facebook.com/docs /graph-api/changelog/version2.11

...或您的问题链接中:

...or in the link of your question:

任何有效的访问令牌都可以读取公共页面上的帖子,但可以回复 将不包含用户信息.

Any valid access token can read posts on a public Page, but responses will not include User information.

页面访问令牌可以读取该页面上发布或由该页面发布的所有帖子,并且响应将包括用户信息.

A Page access token can read all Posts posted to or posted by that Page, and responses will include User information.

这篇关于Facebook Graph API:"Feed"不再返回“发件人" (即作者)字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆