Hi - I use the streaming API to interface to IoT devices, and I am now updating to the new Premium Account Activity API. Yesterday I hit a hurdle with Twitter reporting an error 500 code 131 on the POST request.
I am hosting a Flask server on my internal network with a Public IP address (I have confirmed is accessible). The GET challenge response code is based on the Twitter python reference code. To register the Webhook I use the code below.
Searching the forum shows others experiencing error 500 but mainly on searches, not webhook registration, and the response is to wait and it should go away. I have been experiencing this for over 12hrs now, which suggests more than a temporary Twitter internal error.
Any thoughts or suggestions appreciated.
thanks
Chris.
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)
ENVNAME = os.environ.get('ENVNAME', None)
WEBHOOK_URL = os.environ.get('WEBHOOK_URL', None)
twitterAPI = TwitterAPI(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
response = twitterAPI.request('account_activity/all/:%s/webhooks' % ENVNAME, {'url': WEBHOOK_URL})
print (response.status_code)
print (resposne.text)