"无法验证您"在友谊/使用twit npm包创建

时间:2014-06-05 04:57:30

标签: node.js twitter

我有一个NodeJS应用程序通过twit库与Twitter连接。我在我的应用程序中使用了流式传输和REST API。流式传输效果很好,有些也适用于REST调用,但出于某种原因,

twit.post('friendships/create', {
      screen_name: tweet.user.screen_name,
      follow: false
    }, function (err, resp) {
      if (err) {
        return console.log('friendship gave error: ' + JSON.stringify(err));
      }
      console.log('friended');
    });

始终返回错误:

friendship gave error: {"message":"Could not authenticate you","statusCode":401,"code":32,"allErrors":[{"message":"Could not authenticate you","code":32}],"twitterReply":"{\"errors\":[{\"message\":\"Could not authenticate you\",\"code\":32}]}"}

我很确定我已经过正确的身份验证,否则对twitter的其他调用将无法正常工作......有什么想法吗?

谢谢! 缺口。

1 个答案:

答案 0 :(得分:1)

发现问题: twit库没有正确处理布尔值作为调用的参数: 我改变了

``` 跟随:错误 ``

follow: 'false'

问题解决了。

尼克。

相关问题