-
Notifications
You must be signed in to change notification settings - Fork 35
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 when POST to Tweets endpoint #96
Comments
I confirmed with postman that my credentials do work, and the end point is correct. So there must be something in this module. From what I can see, the auth headers should be the same as the GET request. And the BODY should be converted into JSON properly. I'm not sure where else to look right now |
@ssplatt Were you able to figure it out? I'm having the same issue |
I changed to twitter-api-v2 and that works perfectly |
Hi @ssplatt ! can u share an snipet code using twitter-api-v2 creating a tweet? Thanks! |
This is how I got the auth to work. Then I just used the sample code from the repo |
But were did u get Access and token secret? you need to do the 3-legged auth flow ? Because im building a API so it wouldn't have interaction with the user. Thanks! |
You get those from Twitter in the developers area when you sign up |
I found it. I was confusing about the user flow authentication. But how i will using my own account its not necessary! Thanks for the response men! |
https://twittercommunity.com/t/post-request-returning-error-401-unauthorized/162950/4
following the example in the README,
let response = await client.get('tweets', { ids: id })
works as expected, butlet response = await client.post('tweets', { text: message })
fails with{ code: 401, details: 'Unauthorized' }
. nodejs 17.2.0, windows.It's expected that POST should authenticate using the same method and send a tweet successfully.
Full code example:
The text was updated successfully, but these errors were encountered: