I am interested in sending a tweet using Python. I was told that I need to use OAuth 2 to do that but I am not sure where to get started. I have changed my settings to 'read and write', and I got assigned Client ID and Secret ID credentials but I am unsure what to do with them. For Callback URL I put http://localhost.
I found the below code but it does not seem to utilize Client ID or Secret ID. And with this code I get an error, Forbidden: 403 Forbidden Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].
import tweepy
client = tweepy.Client(consumer_key="",
consumer_secret="",
access_token="",
access_token_secret="")
# Replace the text with whatever you want to Tweet about
response = client.create_tweet(text='test', user_auth=False)
I would appreciate any help! Thanks.