【问题标题】:Can I post reviews on Facebook through an API?我可以通过 API 在 Facebook 上发布评论吗?
【发布时间】:2015-12-29 12:10:11
【问题描述】:

是否可以通过 API 将用户评论发布到 FB 页面?

我想在手机上安装一个应用程序,让用户在走进我的商店时查看我的业务。

编辑:- 这是我迄今为止尝试过的。

我使用 Nodejs 中的护照模块进行身份验证,并能够从 FB 检索访问令牌,包括 manage_pages、publish_pages 和 read_insights。

 app.get('/auth/facebook', passport.authenticate('facebook', { scope : ['email', 'manage_pages','publish_pages','read_insights' ]}));

我的护照策略有这个

    clientID        : configAuth.facebookAuth.clientID, //my app's client id
    clientSecret    : configAuth.facebookAuth.clientSecret, //my app's client secret
    callbackURL     : configAuth.facebookAuth.callbackURL, //the callback URL after authentication
    profileFields: ["emails", "displayName"]

我可以使用 NPM FBGraph 模块作为页面发布。

var graph = require('fbgraph');
graph.setAccessToken(req.user.facebook.token);

graph.post("{My page's ID}/feed", "Message test", function(err, res) {
  console.log(res); // { id: xxxxx}
});

这让我可以将“消息测试”发布到我的页面提要。

我无法通过 Graph API 找到对页面发表评论的参考,我想知道这是否可能。

【问题讨论】:

  • 到目前为止您尝试过什么?你的研究和代码在哪里?你查看过官方文档了吗?
  • 很抱歉最初没有提供任何细节。我现在编辑了问题以包含更多详细信息。

标签: facebook facebook-graph-api facebook-javascript-sdk


【解决方案1】:

https://developers.facebook.com/docs/graph-api/reference/page/ratings#Creating

您无法在此端点上执行此操作。

意思是,这是不可能的。不确定你会用publish_pages 做什么,因为评分/评论是由用户而不是页面做出的......如果可能的话,那么只有publish_actions

【讨论】:

  • 谢谢@luschn,我是 facebook graph api 的初学者,不知道这一点。
猜你喜欢
  • 1970-01-01
  • 2011-11-03
  • 1970-01-01
  • 1970-01-01
  • 2012-09-08
  • 2012-10-11
  • 2012-03-11
  • 1970-01-01
  • 2011-12-20
相关资源
最近更新 更多