I run this code:
import tweepy
client = tweepy.Client(
consumer_key=" CONSUMER KEY ",
consumer_secret=" CONSUMER SECRET ",
access_token=" ACCESS TOKEN ",
access_token_secret=" ACCESS TOKEN SECRET "
)
following = client.get_users_following(1550947094185349127)
print(following)
And got the following response:
Traceback (most recent call last): File "C:\bot\Tests.py", line 11, in following = client.get_users_following(1550947094185349127) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\totes\AppData\Local\Programs\Python\Python311\Lib\site-packages\tweepy\client.py", line 2147, in get_users_following return self._make_request( ^^^^^^^^^^^^^^^^^^^ File "C:\Users\totes\AppData\Local\Programs\Python\Python311\Lib\site-packages\tweepy\client.py", line 129, in _make_request response = self.request(method, route, params=request_params, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\totes\AppData\Local\Programs\Python\Python311\Lib\site-packages\tweepy\client.py", line 98, in request raise Unauthorized(response) tweepy.errors.Unauthorized: 401 Unauthorized Unauthorized
I should mention my API keys are correct, as I am using them for another code that works with no problem.