Reputation: 353
I have been trying to establishing an integration with twitter, what i need is just below features.
I have tried multiple ways, even used 3rd party Libraries like TweetSharp(it worked pretty well.) As i need to deliver this to a client, i dont want to use any third party tools, as there will be no one to support in case of any issues.
First think it should be completely free. So i have tried using OAuth as explained in the below link. i have updated the twitter api version to 1.1 and added my Consumer Key, Secret, AccessToken and Secret. I executed the application. To my surprise, my message was posted on to the twitter. but when i changed the status and executed again, it stopped working and it keep gives my un authorized error.
The example i m following might not be the complete one, may be i need to regenerate a access key and do something else. I m confused. can you please help me how i can proceed further and with link to any post with complete code.
http://www.codeproject.com/Articles/247336/Twitter-OAuth-authentication-using-Net
Thank you.
Upvotes: 0
Views: 1287
Reputation: 441
Just for Info: New API is more strict while sending headers and creating Signature.
Make sure you fulfill these requirements:
Header values should be in sorted order(lexicographically)
GET Request: Header should not include any querystring values. Signature base should contain all values including querystring values
POST Reqeust: Header should include post parameter values. Signature base should contain all values including parameter values Post request Url should append all prameter values in QueryString and requst should be sent to that
This should solve most authorization issues.
Upvotes: 0
Reputation: 7513
Every status must be unique, or you'll receive an error. For this reason, I append the date/time to the end of the tweet when testing.
BTW, if you ever change your mind about 3rd party libraries, check out LINQ to Twitter.
Upvotes: 0