Facebook Graph API:如何获得评论中的“来自"字段 [英] Facebook Graph API: How do I get “from” field in comment

查看:87
本文介绍了Facebook Graph API:如何获得评论中的“来自"字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个未发布的Facebook App(测试模式). 我使用页面访问令牌从我自己的页面上特定帖子中的评论中提取来自"字段.但它返回空字段.

I have a Facebook App which wasn't published(test mode). I used the Page Access Token to extract the 'from' field from comments in a particular post on the my own Page. But it return empty field.

这是我的Graph API查询 =>/[[post-id]/comments?fields = from

This is my Graph API Query => /[post-id]/comments?fields=from

当我使用令牌调试器检查页面访问令牌"时,它具有"manage_pages,pages_show_list,public_profile"权限.

When I checked the Page Access Token with the token debugger, It had 'manage_pages, pages_show_list, public_profile' permissions.

如何从自己页面中的注释中获取来自"字段? 我需要完成应用程序审查还是需要特殊权限(例如页面公共内容访问")?

How do I get the 'from' field from comments in my own Page ? Do I need to complete the app review or do I need special permission to do this(like Page Public Content Access) ?

推荐答案

自Graph API的最新更新以来,为了从用户(甚至是某些公共帖子的作者)获取私人信息.您需要获取具有manage_pages范围的auth令牌,以获取对该页面本身的权限,然后使该应用审阅(

Since the latest update in the Graph API, to get private information from the users, even the author of some public post. You need to get the auth token with the manage_pages scope to get permission to the page itself then get the app reviewed ( https://developers.facebook.com/docs/apps/review ) and last you must go thru the Business Verification or the Individual Verification. The last is a legal contract to use the info.

可现场使用.必须使用PAGE ACCESS TOKEN来获取​​"from"字段.要首先获取该令牌,您必须具有USER ACCESS TOKEN.然后请求

That's for live use. The "from" field must be acquired with the PAGE ACCESS TOKEN. To get that token first you must have the USER ACCESS TOKEN. Then make a request to

GET /v3.2/me/accounts

您会收到这样的答复:

{
  "data": [
    {
        "access_token": "some_big_string",
        "category": "Health/Beauty",
        "category_list": [
            {
                "id": "2214",
                "name": "Health/Beauty"
            }
        ],
        "name": "Page_Name",
        "id": "5648645556490",
        "tasks": [
            "ANALYZE",
            "ADVERTISE",
            "MODERATE",
            "CREATE_CONTENT",
            "MANAGE"
        ]
    }
  ]
}

现在,要获取来自"文件,必须使用该特定页面的令牌,即上述请求中的"access_token"字段.这是一个特定的PAGE ACCESS TOKEN.另一个是用户访问令牌.

Now, to get the "from" filed you must use the token for that specific page, that is the "access_token" field in the request made above. This one is a specific PAGE ACCESS TOKEN. The other one is a USER ACCESS TOKEN.

这篇关于Facebook Graph API:如何获得评论中的“来自"字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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