Facebook Graph api,帖子评论没有显示出来

时间:2016-03-06 08:57:13

标签: node.js facebook facebook-graph-api

我正在使用nodejs中的以下代码将评论发布到facebook帖子(照片):

      var messageBody = "Test"

      var graphApiUrl = 'https://graph.facebook.com/'
        + facebookObjectId
        + '/comments?access_token='
        + appToken;

      log.debug(site + " Posting to : " + graphApiUrl);
      var req = request.post(graphApiUrl, function (err, res, body) {
        if (err)
          return reject('Upload failed:', err);

        body = JSON.parse(body);
        if (!body || body.error) {
          var msg = "";
          if (!body) {
            msg = site + " Failed to update to facebook , invalid resource returned";
            log.error(msg);
            return reject(msg);
          }

          msg = site + " Failed to update to facebook : " + body.error;
          log.error(msg, body.error);
          return reject(msg);
        }


        log.info(site + ' Upload successful! Server responded with:', body);

        var postUrl = "https://www.facebook.com/" + body.id;
        log.info(site + " Successfully posted to facebook : " + postUrl);

        lastUrl.lastUrl = postUrl;
        return resolve(lastUrl);

      });
      var form = req.form();
      form.append('message', messageBody);

哪个工作正常,并回复:

{ id: '10153975808047812_10153975989317812' }

但是,评论没有出现在原帖中。 这种行为类似于我在这里看到的:

https://developers.facebook.com/tools/explorer/145634995501895/?method=POST&path=10153975808047812%2Fcomments&version=v2.5&message=this%20is%20a%20test%20comment

enter image description here

从我在这里读到的内容:https://developers.facebook.com/docs/graph-api/reference/v2.5/object/comments/它似乎正在起作用(如果成功的话:

名称说明类型 ID 新创建的评论ID 字符串)。

那么为什么评论没有出现?难道我做错了什么 ?

0 个答案:

没有答案