Hello,
Last Saturday I submitted a request for an approval of a developer account and I got the option to create an app to get the keys and tokens, though when I tried to use tweepy on python to get tweets, I got the error message “TweepError: Twitter error response: status code = 401”. Does it mean I don’t have an approval and I need to wait to get one or my request got rejected? I’d appreciate your help because I didn’t find any solutions and don’t know what to do. my account is @THorvatt
Thank you and have a nice day,
Tom.
If you can edit / create apps on https://developer.twitter.com/en/portal/projects-and-apps and can see API keys, it’s probably a good sign you’ve got a developer account approved.
401 Unauthorized can also be returned in other circumstances - what exact call are you trying to make and with what parameters? Do you have a code sample (with your keys redacted)
Try a call to API Reference — tweepy 3.10.0 documentation
I got a file i opended to get the keys and tokens i saved, and when i try to get the full text (or created_at, try to get tweets from accounts), I get the error above.
ah ok - what’s the full error message?
and just to make sure - are the keys extracted from the the file definitely valid? there are no extra space characters or newline characters loaded in the string? This is a common issue. you can check:
assert key == key.strip()
assert secret_key == secret_key.strip()
assert token == token.strip()
assert secret_ == secret_.strip()
If you get an error the keys are loaded with extra spaces you must strip.
Also check your system clock is in sync (it affects oAuth)
This is the full error message. Yes, I checked and regenerate them, and copy each one by the copy to clipboard button and still no change.
I checked the code you sent and it didn’t result any errors.
How do I check if my system clock is in sync? I’m on Windows and don’t know how to do it.
I tried now to sync the clock and still no change 