我正在使用FB Webhooks来获取页面的评论,该页面以下列格式提供数据
{
"rating": 5,
"reviewer_id": "1286740178038617",
"reviewer_name": "Souvik Das",
"comment_id": null,
"review_text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ",
"item": "rating",
"verb": "add",
"created_time": 1501152301,
"open_graph_story_id": "1441952429184057"
}
这里的问题是' open_graph_story_id'从该数据引用的页面来自,但为了获取页面数据,我需要该特定页面的访问令牌。我的数据库中有数千页,因此采用强力方法是不切实际的。
答案 0 :(得分:1)
这是我从FB webhook ver 2.9订阅“评级”中获得的数据:
{
"entry": [
{
"changes": [
{
"field": "ratings",
"value": {
"rating": 5,
"reviewer_id": "975746312528574",
"reviewer_name": "Trung Nguyễn Văn",
"comment_id": null,
"review_text": "Hay lắm",
"item": "rating",
"verb": "add",
"created_time": 1501234151,
"open_graph_story_id": "1011062825663589"
}
}
],
"id": "109934616337310",
"time": 1501234153
}
],
"object": "page"
}
在此,我使用id(它的page_id)并在DB上找到它以获取access_token。