Getting error code 348 while trying to add subscription

webhooks

#1

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


#2

@andypiper I just thought to create this new post as I am getting problems with adding subscription. Earlier I had problems with creating the webhooks which got sorted when I used ‘env-beta’ as the environment.

Could you please help with why I am getting the error code 348 - “Client application is not permitted to access this user’s webhook subscriptions.” while trying to add a new subscription?


#3

Hi,

Could you please let me know why I am getting this error?

Thanks
Nidhin


#4

Hi there,

Could I please let me know the way forward?

Thanks
Nidhin


#5

Hi,

Could you please update with a resolution on what could be done to resolve this? The issue was raised a while ago.

Thanks
Nidhin


#6

Do you have the full permissions enabled for your app (Read/Write/DMs)
Also make sure you’re using a token captured AFTER that change was made (if any change was made at all)


#7

@bobber205 thanks for the reply.

Yes, I have given full permission for my App already (Read/Wite/DMs) and had made sure that the tokens I am using are the latest ones after the full permissions have been given.


#8

It was same with me. I’m not sure but, if you changed permission level recently, go to your twitter account’s
’Privacy and settings’, (not your app’s settings.) and go to ‘application’ page. If there is your app in the app list, and allowed range is still only ‘read and write’, you have to fix it.

I deleted it and after confusing regeneration…re-configuration… … finally it worked…(x_x


#9

@cmsn_RT spot on!! Thanks for the valuable comment.

I did the exact same thing and am able to add the subscription now. I am quite sure I haven’t changed the permission level recently but the App still had only “Read and Write” access in the App list in my twitter account.

I revoked the access and regenerated the keys. The issue is solved! I can see “Read, write and Direct Messages” as the permission now.

Thanks a bunch!!