Twitter Authorization for POST Tweet

oauth

#1

Hello!
I’m new to the Twitter API (and APIs in general) and I’ve been trying to make a simple program where I’d be able and post tweets, get tweets etc (from scratch, I’m trying to learn :D).
I’m having problems with authorization and I wish to ask if anyone would be able and tell me and/or point out what I did wrong?
I tried reading word-for-word in the documentation and searched around on google for answers and help but I couldn’t find anything.
I’ve made a repository on GitHub (https://github.com/BloodfallenTear/TwitterAPI-Learning) and I’d be very thankful if someone could help me and/or tell me what I did wrong in order for it to work!
(And before you might ask, I have made sure that my credentials (OAuth Token, OAuth Token Secret etc is correct (and even regenerated those and tried replacing them, but to no avail)) are correct.)
Thank you very much in advance! (If it helps, in VS2017 I’ve been getting the following error: “The remote server returned an error: (401) Unauthorized.”)

EDIT: I have double checked my application permissions are set to “Read, write, and direct messages”.


#2

I don’t know C# so can’t tell right away what could be wrong but if you’ve got everything in https://developer.twitter.com/en/docs/basics/authentication/guides/creating-a-signature implemented correctly one common thing that goes wrong is having your server / pc clock out of sync - which affects oauth signatures, leading to unauthorized errors.


#3

Hi and thank you for your input! :stuck_out_tongue:
I’ve tried rewritting everything from scratch (again…) but to no avail, is there anything I could provide to you which might point to what the problem is (E.g the header)?


#4

No, sorry - i don’t think i could debug that - i’d maybe look at an existing C# twitter library and see how that is implemented - and compare your own implementation to that


closed #5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.