category_lists上有错误吗?

时间:2013-04-16 16:17:58

标签: facebook-graph-api categories

此类https://graph.facebook.com/295212867812这样的网页上的请求曾用于返回category_lists,现在不再返回它们了。这是一个错误,还是某种奇怪的预期行为?

3 个答案:

答案 0 :(得分:2)

category_lists更改已从July 2013 breaking changes

中删除
  

2013年4月9日更新 - 我们正在从此次迁移中删除以下更改

     

页面'类别'字段名称更改   我们正在将“类别”字段重命名为Pages Graph API的“category_lists”

所以,听起来class_lists已经不见了。

然而,有趣的是查询category_list(没有s)会返回有效数据,因此将来可能会正式重命名:

https://graph.facebook.com/295212867812?fields=category_list

{
    "id": "295212867812",
    "category_list": [
       {
          "id": 128003127270269,
          "name": "Bike Shop"
       },
       {
          "id": 193198380699462,
          "name": "Repair Service"
       }
   ]
}

答案 1 :(得分:0)

好吧,转到https://graph.facebook.com/295212867812?fields=category_lists返回:

{
   "error": {
      "message": "(#100) Unknown fields: category_lists",
      "type": "OAuthException",
      "code": 100
   }
}

即使它是您可以在图形api中查询的字段之一(在此处找到:developers.facebook.com/docs/reference/api/page/#fields)

所以,可能是一个错误。或者他们只是不再在页面的图形API中提供它。

然而,这会返回您网页的类别:

graph.facebook.com/295212867812?fields=category

答案 2 :(得分:0)

作为Marty Dill回答的补充,我认为这还没有真正记录下来。至少我没有为Graph API(https://developers.facebook.com/docs/reference/api/user/#likes)或FQL(https://developers.facebook.com/docs/reference/fql/page)找到任何东西。

category_list也会附加到用户喜欢的Graph API响应中(我只是喜欢你的页面......)。查询https://graph.facebook.com/123456789/?fields=id,likes(用您的user_id替换123456789并添加有效的access_token)会导致

{
"id": "123456789",
"likes": {
    "data": [
        {
            "category": "Professional services",
            "category_list": [
                {
                    "id": "128003127270269",
                    "name": "Bike Shop"
                },
                {
                    "id": "193198380699462",
                    "name": "Repair Service"
                }
            ],
            "name": "Bicycle Tech",
            "id": "295212867812",
            "created_time": "2013-05-13T10:19:58+0000"
        }
    ],
    "paging": {
        "next": "https://graph.facebook.com/123456789/likes?limit=5000&offset=5000"
    }
}
}
相关问题