我正在使用Facebook Graph API使用此调用列出我的Facebook页面帖子的所有评论
/v3.1/me?fields=posts{comments{from,message,created_time,comments{from,message,created_time}}}
我是页面管理员,我使用页面访问令牌进行 API 调用。
这就是我得到的(出于隐私原因,涂黑了一些细节(
{
"posts": {
"data": [
{
"comments": {
"data": [
{
"from": {
"name": "██P1██",
"id": "███6166"
},
"message": "Ich poste als ██P1██",
"created_time": "2018-08-02T08:58:47+0000",
"id": "2021000871244096_2067310823279767"
},
{
"from": {
"name": "██U1██",
"id": "███8640"
},
"message": "Ich poste als ██U1██",
"created_time": "2018-08-02T08:59:33+0000",
"id": "2021000871244096_2067311606613022"
},
{
"from": {
"name": "██P1██",
"id": "███6166"
},
"message": "Host an Schülling für mi?",
"created_time": "2018-08-02T09:00:23+0000",
"id": "2021000871244096_2067312356612947"
},
{
"from": {
"name": "██U2██",
"id": "███4255"
},
"message": "Ich bin’s der echte ██U2██.",
"created_time": "2018-08-02T09:02:16+0000",
"id": "2021000871244096_2067313976612785"
},
{
"from": {
"name": "██U3██",
"id": "███2062"
},
"message": "It's a me! ██U3██",
"created_time": "2018-08-02T09:03:43+0000",
"id": "2021000871244096_2067315156612667"
},
{
"message": "such a lonely boat 😢",
"created_time": "2018-08-02T09:15:12+0000",
"id": "2021000871244096_2067325063278343"
},
{
"message": "Der Gerät schneidet das Fleisch schweißfrei.",
"created_time": "2018-08-02T09:18:23+0000",
"comments": {
"data": [
{
"from": {
"name": "██P1██",
"id": "███6166"
},
"message": "Der Gerät ist vor die Chef in Geschäft!",
"created_time": "2018-08-02T09:23:02+0000",
"id": "2021000871244096_2067334489944067"
}
],
"paging": {
"cursors": {
"before": "QVFIUlpUWEduOVRaRGFITEFGajgxaXNadkhMVDVjbUwxMGRuelhRVzdNUHprak81U3dIVTFoQmQydkR1U0I2T09nMVAxcVVaN2Y3S1oyeUMyVVVTTVpMRm5B",
"after": "QVFIUlpUWEduOVRaRGFITEFGajgxaXNadkhMVDVjbUwxMGRuelhRVzdNUHprak81U3dIVTFoQmQydkR1U0I2T09nMVAxcVVaN2Y3S1oyeUMyVVVTTVpMRm5B"
}
}
},
"id": "2021000871244096_2067330469944469"
},
{
"message": "",
"created_time": "2018-08-02T09:19:34+0000",
"id": "2021000871244096_2067331519944364"
},
{
"message": "",
"created_time": "2018-08-09T09:01:43+0000",
"id": "2021000871244096_2079260155418167"
},
{
"message": "Heyho. Ich bins",
"created_time": "2018-08-09T09:10:48+0000",
"id": "2021000871244096_2079269595417223"
},
{
"message": "Heyho. Ich bin nochmal",
"created_time": "2018-08-09T09:11:49+0000",
"id": "2021000871244096_2079270622083787"
}
],
"paging": {
"cursors": {
"before": "WTI5dGJXVnVkRjlqZAFhKemIzSTZANakEyTWpVMU56STNNemMxTlRFeU1qb3hOVE15T1RVMk5UTXgZD",
"after": "WTI5dGJXVnVkRjlqZAFhKemIzSTZANakEzT1RJM01EWXlNakE0TXpjNE56b3hOVE16T0RBMU9UQTUZD"
}
}
},
"id": "195180353826166_2021000871244096"
},
{
"id": "195180353826166_227658903911644"
},
{
"id": "195180353826166_147002885360315"
}
],
"paging": {
"cursors": {
"before": "Q2c4U1pXNTBYM0YxWlhKNVgzTjBiM0o1WDJsa0R5TXhPVFV4T0RBek5UTTRNall4TmpZANk5ESXpNalV5TXpjMU5qZA3hPVFUwTWpnek5ROE1ZAWEJwWDNOMGIzSjVYMmxrRHlBeE9UVXhPREF6TlRNNE1qWXhOalpmTWpBeU1UQXdNRGczTVRJME5EQTVOZAzhFZAEdsdFpRWmJQT2p6QVE9PQZDZD",
"after": "Q2c4U1pXNTBYM0YxWlhKNVgzTjBiM0o1WDJsa0R5UXhPVFV4T0RBek5UTTRNall4TmpZANkxUVTBNamN3T0RrMU16QXlNVE15TWpJNU1UWVBER0ZA3YVY5emRHOXllVjlwWkE4ZAk1UazFNVGd3TXpVek9ESTJNVFkyWHpFME56QXdNamc0TlRNMk1ETXhOUThFZAEdsdFpRWk5XbFQxQVE9PQZDZD"
}
}
},
"id": "195180353826166"
}
如您所见,对于某些评论,缺少"from"字段,我不知道为什么(例如:ID 为 2021000871244096_2067325063278343 的评论("如此孤独的船😢"((。
- P1 是页面本身
- U1、U2 是具有管理员权限的用户
- U3是喜欢该页面的普通用户
2021000871244096_2067325063278343
的作者不喜欢这个页面,但2021000871244096_2079269595417223
的作者后来喜欢它(评论2021000871244096_2079270622083787
(。
有没有办法获取在我的页面上发表评论的所有用户的姓名?
联系FB-Dev-Group和FB-Platform支持。由于用户设置和隐私原因,它们不包括所有内容 https://developers.facebook.com/support/bugs/1618790588170504/
另外,您的应用程序需要获得批准并上线(我的应用程序仍处于开发模式( https://www.facebook.com/groups/fbdevelopers/permalink/1897897803587058