I am trying to use tweepy to operate a twitter account using Python but I appear to have slipped at the the first hurdle. No matter what I try, I keep getting a 403 error with no specific details.
import tweepy
# Consumer keys and access tokens, used for OAuth
consumer_key = 'XXXXXXXXXXX'
consumer_secret = 'XXXXXXXXXXX'
access_token = 'XXXXXXXXXXXX'
access_token_secret = 'XXXXXXXXXXX'
# OAuth process, using the keys and tokens
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
# Creation of the actual interface, using authentication
api = tweepy.API(auth)
# Sample method, used to update a status
api.update_status('Hello')
This is the basic code provided by the tutorial, but it only returns
Traceback (most recent call last):
File "C:\Users\Sam\Documents\Python\TWEEPY\Tweepy.py", line 22, in <module>
api.update_status('Hello')
File "C:\Python34\lib\site-packages\python_twitter-2.1-py3.4.egg\tweepy\binder.py", line 153, in _call
raise TweepError(error_msg)
tweepy.error.TweepError: Twitter error response: status code = 403
Does anyone have any ideas? I can't see why I am forbidden from my request. The keys are not false as far as I can tell.
Thanks