FB Graph API Response Paging Next contains access_token

FB Graph API Response Paging Next contains access_token

现在我正在使用 Graph API 3.2.

是否有机会在我的请求中配置到 Graph API 以不在响应参数末尾取回访问令牌,称为 Paging Next?

即:here is the documentation。 我只是不想在回复中以纯文本形式取回访问令牌,如下所示:

  "feed": {
    "data": [
      {
        "created_time": "2017-12-12T01:24:21+0000",
        "message": "This picture of my grandson with Santa",
        "id": "{your-user-id}_1809387339093972"       // Post ID
      },
      {
        "created_time": "2017-12-11T23:40:17+0000",
        "message": ":)",
        "id": "{your-user-id}_1809316002434439"       // Post ID
      },
      {
        "created_time": "2017-12-11T23:31:38+0000",
        "message": "Thought you might enjoy this.",
        "id": "{your-user-id}_1809310929101613"       // Post ID
      }
    ],
    "paging": {
      "previous": "https://graph.facebook.com/v3.2/{your-user-id}/feed?format=json&limit=3&since=1542820440&access_token={your-user-access-token}&__paging_token=enc_AdCgj6RSGWTYV7EXj2cFlOWJjbZCq8oI3ogIpLrxPCVK3U8Kad0EgsZA2vri3YKIwl71XGRDJz9C8TgqMeyiu8U5CD&__previous=1",
      "next": "https://graph.facebook.com/v3.2/{your-user-id}/feed?format=json&limit=3&access_token={your-user-access-token}&until=1542583212&__paging_token=enc_AdDLmzUgWiLo6oHGCI53S5begiKOfNZBY0affrLMWgheBzfwMA7XSKmgjyNbuZBIptdXc18j1Se0Dm7vEsePh1SoM3"
    }
  },
  "id": "{your-user-id}"
}

还是谢谢!! :)

在别处回答:https://whosebug.com/a/29900228 但在这里也可以参考该答案。

适用于各种 Graph API 版本的解决方案是在 Authorization header:

中传递令牌
return requests.get(url,
                    headers={'Authorization': 'Bearer ' + token})

如果令牌在 header 中传输,则它不会出现在任何地方的响应中。