Uncategorized

Can’t authenticate FREE using Tweepy Python – suggestions? – Twitter API



Hi Folks, this can’t be a new question, but there are so many new updates. I have a new FREE account and just want to send a Tweet. My keys look correct and I am using Tweepy. So, I assume that I am using 1.0 Oauth, I’ve tried two ways. Here is my sample code that refuses to work.

Can you please help me with a current sample to just authenticate with a FREE account?

import os
import tweepy
from other import keys

def main():
hashtag auth = tweepy.OAuthHandler(keys.api_key, keys.api_secret)
hashtag auth.set_access_token(keys.access_token, keys.access_token_secret)
auth = tweepy.OAuth1UserHandler(keys.api_key, keys.api_secret, keys.access_token, keys.access_token_secret)
api = tweepy.API(auth)

try:
api.verify_credentials()
print(“Authentication OK”)
except Exception as e:
print(“Error during authentication”)
print(e)

if name == ‘main’:
main()

THE ERROR:
** tweepy.errors.Unauthorized: 401 Unauthorized**
** 32 – Could not authenticate you.**

** Process finished with exit code 1**

What endpoint are you using?

What API version are you on?

Are you using a library or SDK? Which one? Tweepy, Ubuntu Python3

What is the issue? Can’t Authenticate

Steps to reproduce the issue
Step 1:
Step 2:

What is the error message? See above

When did it start? I am a user this week. Account is active.

What have you tried to troubleshoot? Lots of searching …

Please ignore. It just magically authenticated when I regenerated the keys again … Thank you



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *