Hi everyone,
I’m getting:
{"errors":[{"code":32,"message":"Could not authenticate you."}]}
while trying to create a webhook using https://api.twitter.com/1.1/account_activity/webhooks.json.
- My app has Read, Write and Access direct messages permissions.
- I regenerated the token after changing the permissions and I’m using the new one.
- My webhook handler does not gets any hit
I’m using this script(create-webhook-config.js from twitter-webhook-boilerplate-node):
var request = require('request')
// twitter authentication
var twitter_oauth = {
consumer_key: '0IuI...',
consumer_secret: '18Be...',
token: '2845...',
token_secret: 'JcM...'
}
var WEBHOOK_URL = 'https://4ff464ad.ngrok.io'
// request options
var request_options = {
url: 'https://api.twitter.com/1.1/account_activity/webhooks.json',
oauth: twitter_oauth,
headers: {
'Content-type': 'application/x-www-form-urlencoded'
},
form: {
url: WEBHOOK_URL
}
}
// POST request to create webhook config
request.post(request_options, function (error, response, body) {
console.log(body)
})