繁体   English   中英

Facebook Graph API / me / Feed V2.4 vs V2.3

[英]Facebook Graph API /me/Feed V2.4 vs V2.3

我正在尝试使用Graph API访问facebook用户的所有Feed。

但是我从V2.3到V2.4的反应非常不同。

在版本2.4中使用指令/ me / Feed没有收到帖子的完整信息只返回一些字段,而在以前的版本中可以访问所有信息。 可以看出以下答案的差异。

V2.4

{
"data": [
    {
      "message": "A brincar com o Xico Zé.. ;)",
      "created_time": "2015-07-11T18:23:59+0000",
      "id": "10153293007088673_120153297333223673"
    },
    {
      "message": "Ana Simões e Pedro Simões este é que é bom para a Liliana Assunção..",
      "story": "Diogo Lopes shared Classic Hits 4FM's video.",
      "created_time": "2015-07-11T14:20:59+0000",
      "id": "10153293007088673_1360153296966998673"
    }
],
  "paging": {
    . . .
  }
}

V2.3

{
  "data": [
    {
      "id": "10153129496378673_120153297333223673",
      "from": {
        "name": "Diogo Lopes",
        "id": "10153129496378673"
      },
      "message": "A brincar com o Xico Zé.. ;)",
      "picture": "",
      "link": "",
      "name": "Diogo Lopes on Instagram: “A brincar com o Xico Zé.. ;)”",
      "caption": "Diogo Lopes on Instagram: “A brincar com o Xico Zé.. ;)”",
      "description": "A brincar com o Xico Zé.. ;)",
      "icon": "https://www.facebook.com/images/icons/post.gif",
      "actions": [
. . .
      ],
      "privacy": {
        "value": "ALL_FRIENDS",
        "description": "Your friends",
        "friends": "",
        "allow": "",
        "deny": ""
      },
      "type": "photo",
      "status_type": "added_photos",
      "object_id": "120153297333233673",
      "application": {
        ". . ."
      },
      "created_time": "2015-07-11T18:23:59+0000",
      "updated_time": "2015-07-12T20:50:19+0000",
      "is_hidden": false,
      "subscribed": true,
      "is_expired": false,
      "likes": {
        . . .
        ],
        "paging": {
          . . .
        }
      },
      "comments": {
        "data": [
         . . .
        ],
        "paging": {
          . . .
        }
      }
    },
    {
      "id": "10153129496378673_1360153296966998673",
      "from": {
        "name": "Diogo Lopes",
        "id": "10153129496378673"
      },
      "to": {
        . . .      },
      "message": "………....",
      "message_tags": {
. . .
      },
      "story": "Diogo Lopes shared Classic Hits 4FM's video.",
      "story_tags": {
        "0": [
          {
            "id": "10153129496378673",
            "name": "Diogo Lopes",
            "type": "user",
            "offset": 0,
            "length": 11
          }
        ],
        "19": [
          {
            "id": "125659037470226",
            "name": "Classic Hits 4FM",
            "type": "page",
            "offset": 19,
            "length": 16
          }
        ],
        "38": [
          {
            "id": "874724002563722",
            "name": "",
            "offset": 38,
            "length": 5
          }
        ]
      },
      "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xta1/v/t15.0-10/s130x130/11331624_874724179230371_2123630990_n.jpg?oh=701da51ed6690c70ba8d3e7ba5cbb58c&oe=56273FFC&__gda__=1448812275_e37392fe85f01402fa0565b0086df710",
      "link": "https://www.facebook.com/ClassicHits4FM/videos/874724002563722/",
      "source": "https://video.xx.fbcdn.net/hvideo-xtp1/v/t42.1790-2/11656282_889978921061393_14476072_n.mp4?efg=eyJybHIiOjQ4NCwicmxhIjo1MTJ9&rl=484&vabr=269&oh=a4e7e8ec985cf5374082e5c9639d5b06&oe=55A5ED2C",
      "name": "Classic Hits 4FM",
      "description": "A Giant Nope!!!

Would you go on this Swiss Ride?",
      "actions": [
. . .
      ],
      "privacy": {
        "value": "EVERYONE",
        "description": "Public",
        "friends": "",
        "allow": "",
        "deny": ""
      },
      "type": "video",
      "status_type": "mobile_status_update",
      "created_time": "2015-07-11T14:20:59+0000",
      "updated_time": "2015-07-11T21:28:06+0000",
      "is_hidden": false,
      "subscribed": true,
      "is_expired": false,
      "likes": {
        . . .
        ],
        "paging": { . . . }
      },
      "comments": {
}
…
}

有人可以帮我知道如何在V2.4到V2.3中得到类似的响应?

OBS。 我的facebook应用程序有user_posts权限。

自从Graph API升级即版本2.4。 您必须专门传递一个fields参数,其中包含您要检索的相关关键字。

请参阅Facebook开发者的这份文件

从v2.3到v2.4的变化

声明字段

要尝试提高移动网络的性能,v2.4中的节点和边缘要求您明确请求GET请求所需的字段。 例如,GET /v2.4/me/feed默认不再包含喜欢和评论,但GET /v2.4/me/feed?fields=comments,likes将返回数据。 有关更多详细信息,请参阅有关如何请求特定字段的文档。

v2.4的一个例子:

<page_id>/feed?fields=id,message,picture,likes,shares,comments

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM