From 5dfdae1758512980e14fea8c4c712c523846f51b Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 9 Feb 2021 21:56:21 -0600 Subject: [PATCH] Pass json_payload argument directly in API.create_media_metadata Pass json_payload argument directly to API.request in API.create_media_metadata --- tweepy/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index 3c5ac35..7ea7968 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -364,13 +364,13 @@ class API: def create_media_metadata(self, media_id, alt_text, *args, **kwargs): """ :reference: https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-metadata-create """ - kwargs['json_payload'] = { + json_payload = { 'media_id': media_id, 'alt_text': {'text': alt_text} } return self.request( - 'POST', 'media/metadata/create', *args, + 'POST', 'media/metadata/create', *args, json_payload=json_payload, upload_api=True, **kwargs ) -- 2.25.1