Hi,
As per Andy’s last suggestion I started building a chatbot app. But I am stuck while trying to register the webhook. The error messages are as below:
Status code - 403
Status text - {“errors”:[{“code”:200,“message”:“Forbidden.”}]}
Below is the code that I am using to create Webhook.
My app ID is = 14947302. Could any one please look into it and suggest if I am missing anything?
Thanks in advance.
Regards,
Diggi
from TwitterAPI import TwitterAPI
import os
CONSUMER_KEY = os.environ.get('CONSUMER_KEY', None)
CONSUMER_SECRET = os.environ.get('CONSUMER_SECRET', None)
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN', None)
ACCESS_TOKEN_SECRET = os.environ.get('ACCESS_TOKEN_SECRET', None)
print(CONSUMER_KEY)
#The environment name for the beta is filled below. Will need changing in future
ENVNAME = os.environ.get('ENVNAME', None)
WEBHOOK_URL = os.environ.get('WEBHOOK_URL', None)
print(WEBHOOK_URL)
twitterAPI = TwitterAPI(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
r = twitterAPI.request('account_activity/all/:%s/webhooks' % ENVNAME, {'url': WEBHOOK_URL})
print (r.status_code)
print (r.text)