简体   繁体   English

通过 Graph API 评论 Facebook 页面评级(评论)

[英]Commenting on Facebook Page Ratings (Reviews) via Graph API

Long time lurker first time poster...好久不见...

We are working with Facebooks API's to integrate into our web application and we are able to pull a Companies Page Rating via the {open_graph_story} parameter in the {page-id}/ratings section, however we cannot find a way to comment/reply to the rating.我们正在与 Facebooks API 合作以集成到我们的 Web 应用程序中,我们能够通过 {page-id}/ratings 部分中的 {open_graph_story} 参数提取公司页面评级,但是我们找不到评论/回复的方法评级。 The documentation states:该文件指出:

"If a person has rated your page and a story has been generated, you can follow up with the person by posting to the story's comment node." “如果有人对您的页面进行了评分并生成了故事,您可以通过发布到故事的评论节点来跟进此人。” ( https://developers.facebook.com/docs/graph-api/reference/v2.0/page/ratings ) https://developers.facebook.com/docs/graph-api/reference/v2.0/page/ratings

however when we pull the variables we retrieve no ID to reference for a comment.然而,当我们提取变量时,我们没有检索到 ID 来引用评论。 This is what we receive back from our authenticated account:这是我们从经过身份验证的帐户收到的信息:

"data": [ “数据”: [
{ "created_time": "2014-07-16T05:52:50+0000", { "created_time": "2014-07-16T05:52:50+0000",
"reviewer": { “审稿人”:{
"id": "100000237096397", "id": "100000237096397",
"name": "Romey Salazar" “名称”:“罗密萨拉查”
}, },
"rating": 5, “评分”:5,
"review_text": "Great job guys!!!!" "review_text": "干得好伙计们!!!!"
} ], }],

Does anyone know how to retrieve the id for the rating itself so we can append a comment via API?有谁知道如何检索评级本身的 id 以便我们可以通过 API 附加评论? Or some other way to reply/comment to a FB Page Rating?或者以其他方式回复/评论 FB 页面评级?

Thanks!谢谢!

When you have some ratings/review comments on your page and if you want to post comment to individual review comments as the Page Owner, you can follow the steps below.当您的页面上有一些评分/评论评论时,如果您想以页面所有者的身份对个别评论发表评论,您可以按照以下步骤操作。

1) Below request returns the json object of rating and reviews. 1) 下面的请求返回评分和评论的 json 对象。

https://graph.facebook.com/v2.9/{YOUR_PAGE_ID}/ratings?field=open_graph_story&access_token={YOUR_PAGE_ACCESS_TOKEN}

The response json will contain ID field for each and every rating/review comments.响应 json 将包含每个评级/评论评论的 ID 字段。

2) Using the ID, trigger the below request to post a comment on the rating as the Page Owner. 2) 使用 ID,触发以下请求,以页面所有者的身份发表评论。 You will need Page access token with manage_pages and publish_pages privilege.您将需要具有 manage_pages 和 publish_pages 权限的页面访问令牌。

https://graph.facebook.com/v2.9/{ID_OF_THE_RATING}/comments?message=Thanks for your rating&access_token={YOUR_PAGE_ACCESS_TOKEN}

These requests can be tested using Facebook Graph API Explorer可以使用 Facebook Graph API Explorer 测试这些请求

You need to request the open_graph_story field with the ratings endpoint.您需要使用 ratings 端点请求 open_graph_story 字段。 This will return the open_graph_story data which includes an id.这将返回包含 id 的 open_graph_story 数据。 You can then post to the comments endpoint of this story.然后,您可以发布到此故事的评论端点。

You have to make http get request on你必须在 http get 上发出请求

  1. https://graph.facebook.com/v2.9/ {PageID}/ratings?fields=open_graph_story&access_token={PageAccessToken} https://graph.facebook.com/v2.9/ {PageID}/ratings?fields=open_graph_story&access_token={PageAccessToken}

to get detailed response.以获得详细的答复。 Make sure the parameter is "fields" not "field"确保参数是“字段”而不是“字段”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM