Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized Error 401. Tried to regenerate tokens but still issue persists #69

Open
M-Ather opened this issue Dec 13, 2021 · 10 comments
Open
Labels
Python question Further information is requested

Comments

@M-Ather
Copy link

M-Ather commented Dec 13, 2021

I am using python sample code provided in the repository. But I am getting "builtins.Exception: (401, '{\n "title": "Unauthorized",\n "type": "about:blank",\n "status": 401,\n "detail": "Unauthorized"\n}')" error whenever I try to fetch data using any Endpoint. I tried to regenerate tokens with Read, Write Permissions but still the issue persists.

@M-Ather M-Ather added the bug Something isn't working label Dec 13, 2021
@andypiper
Copy link
Contributor

andypiper commented Dec 16, 2021

Have you set the correct environment variables? Which sample are you running?

@andypiper andypiper added Python question Further information is requested and removed bug Something isn't working labels Dec 16, 2021
@andypiper andypiper self-assigned this Dec 16, 2021
@arb-man-zk
Copy link

Yes - to follow up. Same thing happening to me intermittently. Not sure if it is the control c exit not working properly in node.js, but once it quits on a timeout, it gives me a 401 error when i re open.

@ikemHood
Copy link

ikemHood commented Sep 12, 2022

I do have same error. Making a recent searce with axios (Js) and header contains a bearer token which keeps responding Unauthorized. tried using it on Postman too with the same error. I have regenerated to no avail.

@AkaiSedo
Copy link

I am having the same problem running the sample code "Filtered-Stream" with either needle or axios with node.js.
The environment variable is correct, I re-generated a bearer token, to no avail.
Error: Unauthorized 401
Error: {
"title": "Unauthorized",
"type": "about:blank",
"status": 401,
"detail": "Unauthorized"
}

@andypiper
Copy link
Contributor

  • Is the app part of a project with v2 access?
  • What level of access do you have to the API (this should work fine with Essential Access but just want to check)

@AkaiSedo
Copy link

It is part of v2 access and so far I have Essential account.
I managed to get it to work with needle (maybe temporary issue from twitter side?) but still get some error with axios.
Not sure where the problem is but for now I have a working implementation so I will dig further!

@opostavnicha
Copy link

I keep getting the same error, both using Python and Postman..

@serdarzuli
Copy link

this case it's still open , omg why ?
why nobody helps us ?
i have same problem :/

@vardhans07
Copy link

401
Traceback (most recent call last):
File "c:\Users\dell\Desktop\try_1\tw_se_3.py", line 41, in
main()
File "c:\Users\dell\Desktop\try_1\tw_se_3.py", line 36, in main
json_response = connect_to_endpoint(search_url, query_params)
File "c:\Users\dell\Desktop\try_1\tw_se_3.py", line 31, in connect_to_endpoint
raise Exception(response.status_code, response.text)
Exception: (401, '{\n "title": "Unauthorized",\n "type": "about:blank",\n "status": 401,\n "detail": "Unauthorized"\n}')

[Done] exited with code=1 in 2.356 seconds

@realHakeen
Copy link

realHakeen commented Jul 23, 2024

me 22222. Why no one helps us ...lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python question Further information is requested
Projects
None yet
Development

No branches or pull requests

10 participants