Hi there,
I am creating a chatbot app and as part of that have created a webhook.
But when trying to add subscription using the Webhook id, it’s throwing me
body = {“errors”:[{“code”:348,“message”:“Client application is not permitted to access this user’s webhook subscriptions.”}]}
This is what I am trying to do:
// twitter authentication
var twitter_oauth = {
consumer_key: nconf.get(‘TWITTER_CONSUMER_KEY’),
consumer_secret: nconf.get(‘TWITTER_CONSUMER_SECRET’),
token: nconf.get(‘TWITTER_ACCESS_TOKEN’),
token_secret: nconf.get(‘TWITTER_ACCESS_TOKEN_SECRET’)
}
var WEBHOOK_ID = ‘webhook-id’
// request options
var request_options = {
url: ‘https://api.twitter.com/1.1/account_activity/webhooks/’ + WEBHOOK_ID + ‘/subscriptions.json’,
oauth: twitter_oauth
}
// POST request to create webhook config
request.post(request_options, function (error, response, body) {
console.log("error: " + error);
console.log("response = " + response);
console.log("body = " + body);
if (response.statusCode == 204) {
console.log(‘Subscription added.’)
} else {
console.log(‘User has not authorized your app.’)
}
})
App ID: 14812732
App Name: TestChatBotApp
Owner : nidhintkrishna1
Owner ID : 964525565846982656
Could you please let me know what else I would need to do to add subscription?
Thanks
Nidhin