Reputation: 41
I'm trying to use this function with Python
def create_thread(message_text, media_ids=None):
tweets = [message_text[i:i + 280] for i in range(0, len(message_text), 280)]
if media_ids:
response = client_v1.update_status(status=tweets[0], media_ids=media_ids)
else:
response = client_v2.create_tweet(text=tweets[0])
for tweet in tweets[1:]:
response = client_v2.create_tweet(text=tweet, reply_settings={'reply': {'id': response.id}})
return response
I Have Elevated Access in Twitter and I pay for the Basic plan, which includes the access that I am trying to use in Twitter API V2 and V1.1, but when I try to use this function, it returns the error:
response = client_v1.update_status(status=tweets[0], media_ids=media_ids)
tweepy.errors.Forbidden: 403 Forbidden
453 - You currently have access to Twitter API v2 endpoints and limited v1.1 endpoints only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve
Table of benefits of basic plan
The function tweets a post with an image and a caption
Upvotes: 2
Views: 5785
Reputation: 41
UPDATE_STATUS
in api v1.1 is deprecated and they didnt updated the documentation and the table of benefits for Free/ basic / premium plan.
The solution: Change update_status function to create tweet
Before:
response = client_v1.update_status(status=tweets[0], media_ids=media_ids)
Correct:
response = client_v2.create_tweet(text=tweets[0], media_ids=media_ids)
the documentation says that create tweet doesn't work with media_ids
, but it worked. Also, I have been trying update_status
with the text being sent as Status=tweets[0]
, but must be exchanged to text=tweets[0]
Upvotes: 2