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

查看:162
本文介绍了Facebook Graph API/me/Feed V2.4与V2.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Graph API访问Facebook的所有供稿.

I'm trying to access all feeds a facebook user using the Graph API .

但是从V2.3到V2.4,我得到的响应却截然不同.

However I'm getting quite different responses from V2.3 to V2.4 .

在2.4版中使用说明/me/Feed不能收到帖子的完整信息,只是返回一些字段,而在以前的版本中可以访问所有信息.可以看出以下答案中的区别.

In version 2.4 using the instruction / me / Feed not receive complete information of the posts just returns some fields , while in the previous version had access to all the information. As can be seen the difference in the following answers.

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中获得类似的响应?

Someone can help me know how I can get a similar response in V2.4 to V2.3??

糟透了.我的facebook应用具有 user_posts 权限.

Obs. My facebook aplication have user_posts Permission.

推荐答案

自Graph API(即2.4版)升级以来.您必须专门传递一个fields参数,该参数带有您想要检索的数据的相关关键字.

Since the upgrade in Graph API i.e. version 2.4. You have to specifically pass a fields parameter with the relevant keyword of which, data you would like to retrieve.

请参阅Facebook开发人员的文档

Please refer to this document of Facebook Developers

从v2.3更改为v2.4

Changes from v2.3 to v2.4

声明性字段

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

To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.

v2.4的示例:

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

这篇关于Facebook Graph API/me/Feed V2.4与V2.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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