Getting "Could not authenticate you" errors --- but documentation not so helpful!


#1

Suddenly I am getting {“errors”:[{“message”:“Could not authenticate you”,“code”:32}]} errors, even though I have valid access tokens from our clients. Other 1.1 API calls are working fine, but when we try and access https://api.twitter.com/1.1/search/tweets.json we consistently get this result.

Anyone else seeing this and have any insights into what might be happening? I believe I have the request correct:

	objOAuth.ConsumerKey = OAUTH_CONSUMER_KEY
	objOAuth.ConsumerSecret = OAUTH_CONSUMER_SECRET
	objOAuth.EndPoint = "https://api.twitter.com/1.1/search/tweets.json"
	objOAuth.Parameters.Add "oauth_token", SESSION(OAUTH_TOKEN)
	objOAuth.Parameters.Add "q", thisSearch
	objOAuth.Parameters.Add "count", "100"
	objOAuth.Parameters.Add "since_id", thisStatusId
	objOAuth.RequestMethod = OAUTH_REQUEST_METHOD_GET
	objOAuth.TimeoutURL = OAUTH_TIMEOUT_URL
	objOAuth.Host = TWITTER_API_HOST
	objOAuth.UserAgent = TWITTER_APP_NAME
	objOAuth.Send()

#2

I’m having the same issue with https://api.twitter.com/1.1/users/show.json calls. Seams some of the API endpoints aren’t working properly. Are users calls working for you? I’ve spent over 6 hours looking into it and it seams like a problem on Twitters end, but unfortunately errors are too vague and documentation isn’t helpful in resolving this.


#3

Dear Eric and Kyle, I am trying to get an automated tweet status update as I update my database (insert a new item in the news section of a site which is in Classic ASP). I have tried to work on scott’s example (http://scottdesapio.com/VBScriptOAuth), but I had no luck. Would you be kind enough to guide me through this process?
I already created an app, have all keys and secrets.
Thank you so much.


#4

Hi all – looks like you just need to update your code slightly.

Feel free to use my ASPTwitter class as a starting point. The code already does OAuth authentication and gets tweets, and works with Twitter API 1.1. Just copy the token method and change the API URL and post data:

http://www.timacheson.com/Blog/2013/jun/asptwitter


#5

Although it is not explicitly stated in the [node:130, title=“error codes document”], error code 32 corresponds to a 401 error, indicating a problem with the OAuth signature. I would recommend checking the output of your OAuth library to the [node:3036, title=“reference on signing OAuth requests”]. @timacheson’s response may also be helpful in finding deviations in the signing procedure that might be invalidating your requests.