swyx
#1
Hi! i am working on a github action that tweets commits
I have verified that it works locally:
and can post successfully. however when i try to run the exact same code and exact same credentials (verified) from a github action i get a 401
What on earth could be the cause of this? is Twitter blocking github origins somehow and erroneously giving me a 401? because i’m pretty sure my credentials are okay. but in any case… can we have twitter-side logs or some way to debug this issue because it is pretty opaque.
thank you in advance
1 Like
Does it work with a different library? Or with v1.1 API not v2?
i’m using hunterlarco/twitter-v2 and getting the same 401 error when trying to POST /tweets/. the library hasn’t been updated in 8 months but from what I can tell it’s basically just a convenience wrapper and should work. I’m having trouble in Postman as well when I try to verify the credentials.
2 Likes
swyx
#4
hi Igor, it’s just v2 - i dont have Elevated Access to v1 so I cant verify if it works on v1.
But thats almost beside the point - how come it works locally and not in github actions?
Meta question: how can Twitter improve the developer experience when running into a 401 (my suggestions - logs on the twitter dev dashboard side?)
1 Like
Yeah - the 401 error is not very descriptive at all.
For this example though, maybe it’s the library after all?
swyx
#6
ah very helpful, thanks igor i will go try that library.
1 Like