Twitter status update failed C# Twitterizer

1.1k views Asked by At

Twitter status update failed with Error: 'Could not authenticate with OAuth.' The following is the code I put in button1. How do I fix this error? Thanks

        OAuthTokens tokens = new OAuthTokens();
        tokens.AccessToken = "I put my accesstoken";
        tokens.AccessTokenSecret = "I put my tokensecret";
        tokens.ConsumerKey = "I put my consumer key";
        tokens.ConsumerSecret = "I put consumer secret";

        TwitterResponse<TwitterStatus> tweetResponse = TwitterStatus.Update(tokens, "sample tweet");
        if (tweetResponse.Result == RequestResult.Success)
            MessageBox.Show("Twitter status successfully posted");
        else
            label13.Text = string.Format("Twitter status update failed with Error: '{0}'",
                tweetResponse.ErrorMessage);
2

There are 2 answers

0
Abdul Qayyum On

Eather your application is deleted or your made error to write token ,secret and keys ect. recheck these this and goto your application setting and select read write and access direct messages here it is enter image description here

ALL the Best...

0
Hernaldo Gonzalez On

This example work for me: http://www.codeproject.com/Questions/176201/How-Do-I-MyStatus-Update-Twitter-Twitterizer2-C

Also:

  • I create only 1 page names "test.aspx" that make an Update in Twitter
  • In https://dev.twitter.com/apps/new my Callbak url was: http://172.0.0.1/auth/twitter/callback
  • To run with F5 its work as: http://localhost:53303/Test.aspx