Sudden not authorized error


#1

I created an application in C# for retrieving mentions from my own account following the single-user oAuth documentation. This has been working great for more than a year now. However recently it started returning not authorized errors for no reason I can see. I tried creating a new application on my account with permission to read, write and direct messages and generated new access tokens, but the problem persists. I left it a couple of days then checked the permissions and tokens to make sure twitter had updated my settings properly but it made no difference. I create the following url in my application to post using the WebRequest method in C#(Keys are fake of course).

https://api.twitter.com/1/statuses/mentions.xml?oauth_consumer_key=gdfgfdgdfgfdg&oauth_nonce=7658653&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1332157651&oauth_token=6565400-dgdfgd4fg584df5g4df4g5dfg&oauth_version=2.0&oauth_signature=gdfgdfg46dfg545

Can anyone tell me if I am missing anything from the url, or whether anything has changed in the twitter API regarding authorization or mentions. I am pulling my hair out trying to figure out what’s wrong, any help will be appreciated.


#2

Did the timing of this stopping working correlate at all with the daylight savings time change? Make sure you’re generating timestamps in UTC and that they are correct irrespective of the DST.


#3

This is the function I use to create timestamps.

public virtual string GenerateTimeStamp() { // Default implementation of UNIX time of the current UTC time TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0,0); return Convert.ToInt64(ts.TotalSeconds).ToString(); } This appears to already generate the timestamp in UTC.

#4

Can you verify that the resultant number is accurate?
(It’s currently “Mon Mar 19 08:06:50 -0700 2012”, which is “1332169610” in epoch time)

Once you’ve ruled this out, move on to some other investigations you can make: [node:204].