如何在Twitter注册一个webhookurl?

如何在Twitter中注册Twitter Webhookurl? 我成功地使用纯应用程序authentication来授权我的应用程序。 我相信在https://api.twitter.com/1.1/account_activity/webhooks.json中发送POST请求时,仅需要应用程序authentication。

所以这里是我的代码,

HTTP.call('POST', 'https://api.twitter.com/oauth2/token', { params: { 'grant_type':'client_credentials'}, headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'Authorization': 'Basic '+base64token } },function (error, response) { if (!error && response.statusCode == 200) { token = response.data.access_token; HTTP.call('POST', 'https://api.twitter.com/1.1/account_activity/webhooks.json', { params: { 'url':'https://someurl.com/twitter'}, headers: { 'Authorization': 'Bearer '+token } },function (error, response) { if (!error && response.statusCode == 200) { console.log(response); } else { console.error(error.message); } }); } else { console.error(error.message); } }); 

我收到的错误是“{”错误“:[{”code“:261,”message“:”应用程序不能执行写操作。 通过https://support.twitter.com/forms/platform与Twitter平台运营部门联系。“}]}”

这里有什么问题? 我该如何解决这个问题?

这个错误是由于违反服务条款而造成的。 这是相当普遍和容易得到解决。

确定您的应用程序是否受到限制

  • login到您用来注册应用程序的帐户
  • 访问Twitter的应用程序pipe理网站( https://apps.twitter.com
  • 在该页面上,只有当应用程序不能再执行写入操作时,“无法执行写入操作”才会出现在应用程序的名称下方。

在这里输入图像说明

限制的结果

尝试通过处于此状态的API密钥访问基于写入的Twitter API方法(例如状态/更新或collections夹/创build)将导致我们的API返回HTTP 403响应错误:“应用程序无法执行写入操作。 通过https://support.twitter.com/forms/platform与Twitter平台运营部门联系。“

如何解决

在Twitter支持页面上提出一张票: https : //support.twitter.com/forms/platform

吸引力只需要5分钟,Twitter的解决速度非常快