【问题标题】:How should we retrieve an individual post now that /[post-id] is deprecated in v2.4?既然 /[post-id] 在 v2.4 中已被弃用,我们应该如何检索单个帖子?
【发布时间】:2015-07-11 04:57:23
【问题描述】:

我刚刚尝试使用此路径 /v2.4/10153513872748291 通过 Graph API Explorer,我得到了以下结果:

{
  "error": {
    "message": "(#12) singular links API is deprecated for versions v2.4 and higher",
    "type": "OAuthException",
    "code": 12
  }
}

但是https://developers.facebook.com/docs/reference/api/post/ 没有说任何关于弃用的内容。

我不确定我是否遗漏了什么,或者还有其他方法可以获取有关单个帖子的信息。

编辑:v2.3 有效,但 v2.4 是最新版本。

【问题讨论】:

  • 使用不同的'v'?
  • 是的,v2.3 有效,但我想使用正确的版本,即 v2.4。

标签: facebook facebook-graph-api


【解决方案1】:

看起来您现在需要将发布帖子的用户或页面的 ID(或帖子所在的墙)、下划线和帖子 ID 组合在一起。

对于您的示例帖子10153513872748291,它由页面Drama-addict 制作,其ID 为141108613290 - 所以141108613290_10153513872748291 可以工作。

788239567865981_10153513872748291 也是如此,因为788239567865981 是发布帖子的用户的 ID。

【讨论】:

  • 哇,谢谢。这样可行。一个问题:您如何(或在哪里?)发现它需要是 userId_postId?
  • 当您通过 /{user_or_page_id}/feed 请求用户或页面帖子时,之前的 API 版本已经将该格式返回为 id 字段的值……所以我只是尝试了它是否适用于 v2.4 ;-)
  • 现在我收到一个错误{\"message\":\"(#12) picture edge for this type is deprecated for versions v2.3 and higher\",\"type\":\"OAuthException\",\"code\":12,
  • 这显然不再有效"Unsupported get request. Object with ID 'XXX_XXX' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api"
  • @PhoenixNoor 它工作得很好。如今,Facebook 自己通过 API 返回这种 id。您的应用很可能没有读取该特定对象的必要权限。
【解决方案2】:

先输入 userId 下划线添加 postId /Likes 以检查 Facebook 中的 Like 状态

userId_post_Id/Likes 以获取 Likes 记录

userId_post_Id/Comments 获取评论记录

    https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=303261006522998_751199848395776%2FLikes&version=v2.9

    **In this link Right side Get Token indide GetAccessToken to select Permission**

    303261006522998_751199848395776/Likes
    303261006522998_751199848395776/Comments

{
  "data": [
    {
      "id": "124778301449917",
      "name": "Manisha Gera"
    },
    {
      "id": "1680577265523548",
      "name": "Rubi Sharma"
    }
  ],
  "paging": {
    "cursors": {
      "before": "MTI0Nzc4MzAxNDQ5OTE3",
      "after": "MTY4MDU3NzI2NTUyMzU0OAZDZD"
    }
  }
}

【讨论】:

  • 需要权限 user_id 或 user_likes
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-02
  • 2022-12-11
相关资源
最近更新 更多