[twitter-dev] 401 error from CRON job

2011-06-08 Thread tomofo
Ok, folks, this is driving me out of my mind and I need some help.

I'm running a simple CRON job in Rails, that will be used to manage a 
Twitter List. For some reason, whenever I call a protected method, I get a 
401 error. I'm using a single access token, and have triple checked that the 
app and oauth tokens are correct. Code snippet is simple:

  client = Twitter::Client.new(
:consumer_key = 'CK',
:consumer_secret = 'CS',
:oauth_token = 'OT',
:oauth_token_secret = 'OS')

  client.list_add_member 'myuser', 'automotive', 
Twitter.user(otheruser).id

Throws the error:
GET 
http://twitter-api-app11.apigee.com/1/account/verify_credentials.json: 
401: Could not authenticate with OAuth.

From the Nunemaker docs, this should be trivial. What am I missing?

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] 401 error is back

2011-03-19 Thread ShanghaiTimes
22 days ago my Gadget stopped working. Been working fine for at least
6 months.
Nothing changed - I have been away, however now.

Current Time Referenced To Twitter Server
Sun Mar 20 02:23:02 + 2011
[Attempting Update] - ( 90-chrs Used / 50-chrs Remaining )
Bruce Daigrepont - Disco Et Fais Do Do by Bruce Daigrepont... on
http://Quantum-Radio.net
Update Failed - [Return Code] = 401 - Unauthorized

I have checked all the codes/tokens, and all are correct.
Nothing has changed - except now the update no longer works.

Any help would be much appreciated.
bc

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


Re: [twitter-dev] 401 error what am i doing wrong here (user search)

2010-12-25 Thread Ciaran
Just out of interest does your searchbterm contain commas? If so when
using twitter you'll need to encode this parameter first before
passing the URL to the client (it seems :( )
-cj

On Thursday, December 23, 2010, Cujo deko...@gmail.com wrote:
 For the last call i rewrote my code to set the Authorization
 RequestHeader to:
 OAuth realm=http%3A%2F%2Fapi.twitter.com,
 oauth_consumer_key=[mykey], oauth_signature_method=HMAC-SHA1,
 oauth_token=[accesstoken], oauth_version=1.0,
 oauth_timestamp=1293101327, oauth_nonce=b37Zm8,
 oauth_signature=[signature]

 With result:
 ?xml version=1.0 encoding=UTF-8?
 errors
   error code=32Could not authenticate you/error
 /errors
 And with responseHeaders :
 Via: 1.0 SMTTMG
 Connection: Keep-Alive
 Proxy-Support: Session-Based-Authentication
 Connection: Proxy-Support
 Transfer-Encoding: chunked
 Expires: Thu, 23 Dec 2010 08:30:06 GMT
 Date: Thu, 23 Dec 2010 08:00:06 GMT
 Content-Type: application/xml; charset=utf-8
 Server: hi
 Status: 401 Unauthorized
 WWW-Authenticate: Basic realm=Twitter API
 X-Runtime: 0.01106
 Cache-Control: no-cache, max-age=1800
 Set-Cookie: _twitter_sess=VERYLONGSIGNATUREacbd; domain=.twitter.com;
 path=/

 Does that mean the the Authorization did not come through, since the
 WWW-Authenticate says Basic?

 On 22 dec, 14:50, Cujo deko...@gmail.com wrote:
 I followed the whole oAuth chain to aquire an accesstoken for my
 application:
 Call 1:
 sent:https://api.twitter.com/oauth/request_token?oauth_consumer_key=[mykey]oauth_signature_method=HMAC-SHA1oauth_timestamp=1293014232oauth_n­once=OgIwk4oauth_signature=[signature]

 result:
 oauth_token=[token]oauth_token_secret=[tokensecret]oauth_callback_confirm­ed=true

 Call 2: (after receiving a pincode)
 sent:https://api.twitter.com/oauth/access_token?oauth_consumer_key=[mykey]oauth_token=[token]oauth_signature_method=HMAC-SHA1oauth_verifier­=[pincode]oauth_timestamp=1293014245oauth_nonce=UZN6pWoauth_signature=[s­ignature]

 result:
 oauth_token=[accesstoken]oauth_token_secret=[accesstokensecret]user_id=42­198282screen_name=kooijtje

  Call 3: (i should be able to do a search since i have an access
 token)
 sent:http://api.twitter.com/1/users/search.xml?q=[searchterm]oauth_consumer_key=[mykey]oauth_token=[accesstoken]oauth_sig­nature_method=HMAC-SHA1oauth_timestamp=1293014246oauth_nonce=nV8zJ7oauth­_signature=[signature]

 sent:http://api.twitter.com/1/users/search.xml?oauth_consumer_key=[mykey]oauth_nonce=wwQs4poauth_signature_method=HMAC-SHA1oauth_timestamp­=1293024508oauth_token=[accesstoken]oauth_version=1.0q=[Searchterm]oaut­h_signature=[signature]

 Both are giving the following 401 error with this response:
 xml version=1.0 encoding=UTF-8?
 hash
   request/1/users/search.xml?
 oauth_consumer_key=[mykey]amp;oauth_nonce=dD7PvNamp;oauth_signature_metho­d=HMAC-
 SHA1amp;oauth_timestamp=[timestamp]amp;oauth_token=[accesstoken]amp;oaut­h_version=1.0amp;q=[Searchterm]amp;oauth_signature=[signature]/
 request
   errorIncorrect signature/error
 /hash

 Currently through the lib i am using all parameters (including the q)
 are used to calculate the oauth_signature, is this wrong? Should only
 the oauth_* parameters be used? I tried this but still incorrect
 signature error.
 The algorithm for calculating seems to be signature correct since i am
 able to succesfull get an accesstoken?

 Any idea's?

 --
 Twitter developer documentation and resources: http://dev.twitter.com/doc
 API updates via Twitter: http://twitter.com/twitterapi
 Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
 Change your membership to this group: 
 http://groups.google.com/group/twitter-development-talk


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


[twitter-dev] 401 Error

2010-09-06 Thread Farrukh Javeid
Hi,

I have been trying to figure out a method to handle the 401 error but
cannot actually find any particular solution. I have even tried the
synchronizing my time with the internet server but still to no avail.

Any help might be really helpful as I have already wasted 2 days on
it.

Warm Regards,
Farrukh Javeid

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


Re: [twitter-dev] 401 Error

2010-09-06 Thread Alan Alves Luiz
Me too! I'm using twitter4j and every function that uses oAuth autentication
gives to me headeache!!! :(
I can't figure out

2010/9/6 Farrukh Javeid farruk...@gmail.com

 Hi,

 I have been trying to figure out a method to handle the 401 error but
 cannot actually find any particular solution. I have even tried the
 synchronizing my time with the internet server but still to no avail.

 Any help might be really helpful as I have already wasted 2 days on
 it.

 Warm Regards,
 Farrukh Javeid

 --
 Twitter developer documentation and resources: http://dev.twitter.com/doc
 API updates via Twitter: http://twitter.com/twitterapi
 Issues/Enhancements Tracker:
 http://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
 http://groups.google.com/group/twitter-development-talk?hl=en


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en


[twitter-dev] 401 Error

2009-08-29 Thread Andreo Vieira

I need some help Sorry for my English(I'm from Brazil).
I'm developing one program using oAuth and c# twitter library...
Everything works fine except when I try to send an update using
characters like 'ç'... I make some tests and I have strange results...

e.g: When I send an update Vou Almoçar! (I'm going to have lunch) I
get error 401 Unauthorized... but if simply send 'ç' as update I don't
get the 401 error...But there is another problem. If i change the 'ç'
to 'c' I don't get the error too.

Someone help?


[twitter-dev] 401 Error, could not authenticate you problem

2009-08-17 Thread havis

Hello, i am working on a project for mobile phones and Twitter API. I
made tests using java platform and everything works ok, when i use the
same credentials in j2me, there is always the following message as
response:

?xml version=1.0 encoding=UTF-8?
hash
  request/statuses/friends_timeline.xml/request
  errorCould not authenticate you./error
/hash


I am using basic authentication. Did you have this problem? Can
anybody help me please? thanks in advance.