Getting Facebook Reactions with Graph API

后端 未结 7 1968
你的背包
你的背包 2020-12-23 20:47

Facebook just released the new reaction button, but I can\'t figure out a way to get this information from the Graph API v2.5 as the /likes edge only returns the total count

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 21:14

    Facebook just released Graph API 2.6 and the reaction endpoint is available like so

    GET /v2.6/{object-id}/reactions
    

    Which returned something like

    {
      "data": [
        {
          "id": "ACCOUNT-ID",
          "name": "ACCOUNT-NAME",
          "type": "HAHA"
        },
        {
          "id": "ACCOUNT-ID",
          "name": "ACCOUNT-NAME",
          "type": "LIKE"
        }
      ],
      "paging": {
        "cursors": {
          "before": "TkRZAMU9EWTROakF6TmpBM01qYzJPak2TnpnNE5qUTRNRE0zT1RFek16RXkZD",
          "after": "TVRBd01EQTNOekEwTWpnME1EUTJPakUwTazJNVFl4TXc9PQZDZD"
        }
      }
    }
    

    More infos here : https://developers.facebook.com/docs/graph-api/reference/post/reactions/

提交回复
热议问题