【问题标题】:How to get facebook user info along with post info using graph api如何使用图形 api 获取 facebook 用户信息和帖子信息
【发布时间】:2016-01-28 13:18:11
【问题描述】:

我正在尝试使用 Facebook Graph API 从 Facebook 页面获取访问者帖子。 欲了解更多信息,请参阅:https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed

根据文档,我使用这个:**/{page-id}/tagged?fields=message,id,created_time,from** 来获取已标记页面的公共帖子。

我还使用“from”字段获取用户信息。

我能够得到帖子数组。这是示例响应。

{
    "data": [
        {
            "message": "Sample message text...",
            "id": "136617136381867_1041817205861851",
            "created_time": "2016-01-28T12:13:37+0000",
            "from": {
                "name": "Annu Chelladurai",
                "id": "10152476225064109"
            }
        }
        .
        .
        .
    ]
}

我能够在“from”键下获取用户 ID 和用户名。

如何获取“图片”等其他用户信息字段?

【问题讨论】:

    标签: facebook facebook-graph-api facebook-graph-api-v2.4


    【解决方案1】:

    终于明白了。。 https://developers.facebook.com/docs/graph-api/using-graph-api#fields

    我们可以使用嵌套请求,如上述文档中所述。

    所以请求修改为**/tagged?fields=id, created_time, message, from{id, name, picture, location }**

    它就像一个魅力。它还给了我用户信息和图片网址。

    {
        "data": [
            {
                "id": "136617136381867_1042310465812525",
                "created_time": "2016-01-29T08:14:32+0000",
                "message": "Dear Sir,
    
                \ "77000002 TERM DEBIT CARD ADJ 18-01-16\" Can you explain why this charge?And Deduction happend more than 30 times
                I am having HDFC Salary a / c 01331610161892,
                in my account Rs11 .24 is
                charged 30 times as\ "77000002 TERM DEBIT CARD ADJ 18-01-16\" with same description. What is this with out any prior information you
                are charging.
                It is illegal you have not mentioned this type of deduction any where.
    
                Pleaseget back to me as soon as possible.else i have to close all service which i am taking from HDFC UNWILLINGLY
    
                I have loan from hdfc
                I have my salary account in hdfc
                I am using HDFC debit card
                I applied
                for Credit Card too..
                ",
                "from": {
                    "id": "785918218185264",
                    "name": "Arun Gupta",
                    "picture": {
                        "data": {
                            "is_silhouette": false,
                            "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xlp1/v/t1.0-1/p50x50/1725162_823511061092646_1294656835996703680_n.jpg?oh=81e21c67e4b01f6b60784749827090d3&oe=573FE3C5&__gda__=1462383820_126055db9c94eb67294e2d73d4d46dd3"
                        }
                    }
                }
            }
            .
            .
            .
        ]
    }
    

    希望,这会对某人有所帮助... :)

    【讨论】:

      猜你喜欢
      • 2012-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多