epired token response

Apr 19, 2011 at 10:26 AM

Hi,

i try to use updateStatus(string) and DestroyStatus(string) methods but each time it fails.

i use MVC and Asp.net 4.0.

here is the code i use for the updatestatus() :

public bool createTweet(string tweet, string accessToken, string secretToken, Uri urlCallback)
        {
            if (_credentials.ConsumerKey == null || _credentials.ConsumerSecret == null)
            {
                _credentials.ConsumerSecret = ConfigurationManager.AppSettings[@"ConsumerSecret"];
                _credentials.ConsumerKey = ConfigurationManager.AppSettings[@"ConsumerKey"];
                _credentials.AccessToken = accessToken;
                _credentials.OAuthToken = secretToken;
            }
            MvcAuthorizer auth = new MvcAuthorizer { Credentials = _credentials };
            if (auth.IsAuthorized)
            {
                try
                {
                    ServicePointManager.Expect100Continue = false;
                    _twitterCtx = new TwitterContext(auth);
                    _twitterCtx.UpdateStatus(tweet);
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
            else
                return false;
        }

i've verified my access token and my secret token, they're valid.

my application is well authorized and has the read/write access.

i've try to remove and renew the authorization, but nothing changed.

i allways have this message error :

message : Error while querying Twitter.

InnerException : {"Le serveur distant a retourné une erreur : (401) Non autorisé."}, System.Net.WebExceptionStatus.ProtocolError ,    à LinqToTwitter.OAuthHelper.GetResponse(HttpWebRequest req)
   à LinqToTwitter.OAuthAuthorizer.Post(String url, Dictionary`2 args)
   à LinqToTwitter.TwitterExecute.ExecuteTwitter[T](String url, Dictionary`2 parameters, IRequestProcessor`1 reqProc)

response : Invalid / expired Token

response request: /1/statuses/update.xml?status=test%20de%20linq&display_coordinates=False

Apr 19, 2011 at 10:31 AM

however i can retrieve my status and public status.

don't know if this help.

Coordinator
Apr 19, 2011 at 6:23 PM

A couple things you might look at:

1. Visit dev.twitter.com and double check your ConsumerKey and ConsumerSecret and make sure they have full access.  This type of problem is characteristic of the application being set to read-only.

2. Re-do the OAuth dance to generate the OAuthToken and AccessToken again.  They shouldn't have changed, but I'd check anyway and make sure you're assigning the right tokens in the right properties.

Joe

Apr 19, 2011 at 7:58 PM

i've the right consumer key and consumer secret and i've full access (read and write)

i've re-do OAuth dance and i've the right tokens... but it doesn't work.

any other idea?

Apr 19, 2011 at 8:13 PM

i've heard that update and delete must have url encoded now or may be i don't use the correct synthax for this feature...