Page 1 of 1

401 Unauthorized error when trying to get mentions on twitter

Posted: Thu Aug 08, 2013 5:53 pm
by Diego Esteban Osorio Zaldivia

Hello dear!

Do you know if there is any difference between the authorization header used to send a tweet on twitter (https://dev.twitter.com/docs/api/1.1/...) and the authorization header used to read the mentions, the user timeline or see a user data?

I am based on twitter tutorials you have, in which use GET and Application-only authentication to search tweets (Building twitter search app) and POST and Application-user authentication to post tweets (Building a Twitter App to Send Tweets) .

If you notice, I'm trying to run resources Twitter API using GET and Application-user authentication, so I'm generating the authorization parameter in the same way that you did in "Building a Twitter App to Send Tweets" and I'm running GET service with the URL https://api.twitter.com/1.1/statuses/.... But, I'm having 401 Unauthorized error and I have not been able to fix.

The public link to my application is here.

I'm forgetting some detail? Any idea?

Thanks in advance,


401 Unauthorized error when trying to get mentions on twitter

Posted: Thu Aug 08, 2013 8:06 pm
by Oleg Danchenkov

Hi, Diego.
1) You don't map "count" to "Authorization" in GetMentionsDS service, but you should.
2) Check this https://dev.twitter.com/discussions/1...
I think you have problem with prefix when building the authentication header. You use leading "POST&". See TwitterSendJS.js row
codesignBaseString = 'POST&' + this.encodeSymbols(apiUrl) + '&' + this.encodeSymbols(signBaseString);/code
but you should use "GET&" for requests with method GET


401 Unauthorized error when trying to get mentions on twitter

Posted: Thu Aug 08, 2013 8:39 pm
by Diego Esteban Osorio Zaldivia

thanks so much! I had not noticed that detail and now I check it!


401 Unauthorized error when trying to get mentions on twitter

Posted: Sat Feb 22, 2014 2:49 pm
by Matt6607699

Hi, I have been stuck with this 401 error: {"errors":[{"message":"Could not authenticate you","code":32}]}
for days now and for the life of me can't figure out whats wrong. I have followed this tutorial:
http://docs.appery.io/tutorials/build...
My intent of using this is just to use the login(from the login page)to Authenticate a user before creating an entry in my database for them. After they login they will use the appery session token. SendService will eventually be replaced by a GET request to gather user profile data for db.
I am able to get the user routed to twitter login and login pin given. When entered, the Request token and access token are granted but the TwitterSend_SendService gets an error every time without the debugger telling me why. Any Ideas?

I noticed that the twitter user_ID is appended to the beginning of the oauth_token for this POST, is that normal?

public link:
http://appery.io/app/view/dcb8e8fb-c7...

Thank you for any help you can provide.


401 Unauthorized error when trying to get mentions on twitter

Posted: Mon Feb 24, 2014 3:53 am
by Alena Prykhodko