【问题标题】:Facebook Batch query for postsFacebook 批量查询帖子
【发布时间】:2013-04-11 04:02:52
【问题描述】:

我在批量查询 POST 方法中使用以下查询获取页面发布结果和评论计数。

批处理:[{"name":"post-resultset","method":"GET","re​​lative_url":"me/posts?offset=0&limit=2"},{"method":"GET" ,"relative_url":"fql?q=SELECT post_id, comment_info from stream where post_id IN ({result=post-resultset:$.data.*.id})"}]

我收到错误代码 400 的响应

{"error": {"message": "(#601) 解析器错误:位置 74 处出现意外的 '_435851216505244'。","type": "OAuthException","code": 601 }}

这个查询有什么问题?

【问题讨论】:

    标签: facebook facebook-graph-api


    【解决方案1】:

    这是由于post-resultset:$.data.*.id上的post_id没有用引号括起来,比如

    "relative_url":"fql?q=SELECT post_id, comment_info from stream where post_id IN (\"1234567_435851216505244\")"

    我认为这是一个 facebook 错误,您应该在 https://developers.facebook.com/bugs 上报告错误

    【讨论】:

    • 谢谢。 [{"omit_response_on_success":false,"name":"post-resultset","method":"GET","re​​lative_url":"me/posts"},{"method":"GET","re​​lative_url": "fql?q=SELECT comment_info from stream where post_id IN (\'{result=post-resultset:$.data.*.id}\')"}] 这个查询对我有用。
    • @PonmalaK 嗨,我很好奇它是如何为您工作的,因为即使使用 Graph API explorer 也无法工作
    猜你喜欢
    • 2023-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-12
    • 1970-01-01
    相关资源
    最近更新 更多