Twitter API抱怨“Narrowcast id params必须是整数”。

时间:2016-11-20 15:55:28

标签: javascript node.js twitter

我正在使用Twitter npm模块,并使用类似

的内容发布到favorites/destroy.jsonfavorites/create.json
favorites/destroy.json?id=800364979287425024

我得到{ code: 96, message: 'Narrowcast id params must be integers.' }。有谁知道发生了什么事? Twitter API文档中没有任何内容。

我尝试使用和不使用引号发送ID,但没有运气。

1 个答案:

答案 0 :(得分:4)

问题是我发送id作为查询参数,而不是POST主体。 Twitter documentation for the route包含使用查询参数而不是帖子正文的错误示例代码。

像这样的身体有效。

{ id: 800364979287425024 }