From 9ed1d33354ed04c819a3a25a26349affb68e4bad Mon Sep 17 00:00:00 2001 From: Nani Shin Date: Sun, 20 Mar 2022 03:01:23 +0900 Subject: [PATCH] Fix 401 unauthorized error Fix 401 unauthorized error by missed write permission ---- $ python3 delete_tweet.py Traceback (most recent call last): File "delete_tweet.py", line 67, in raise Exception( Exception: Request returned an error: 401 { "title": "Unauthorized", "type": "about:blank", "status": 401, "detail": "Unauthorized" } --- Manage-Tweets/delete_tweet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manage-Tweets/delete_tweet.py b/Manage-Tweets/delete_tweet.py index 5aff4bc..836ceb4 100644 --- a/Manage-Tweets/delete_tweet.py +++ b/Manage-Tweets/delete_tweet.py @@ -16,7 +16,7 @@ # Get request token -request_token_url = "https://api.twitter.com/oauth/request_token" +request_token_url = "https://api.twitter.com/oauth/request_token?oauth_callback=oob&x_auth_access_type=write" oauth = OAuth1Session(consumer_key, client_secret=consumer_secret) try: