close
The Wayback Machine - https://web.archive.org/web/20130307231912/https://dev.twitter.com/issues/890

Issue #890: Perl application can receive DMs but not send them

Since last night my perl client (Net::Twitter 2.x) can receive my DMs but attempting to send them returns an error:

  1. HTTP/1.1 401 Unauthorized
  2. Content-Type: application/json; charset=utf-8
  3. Content-Length: 63
  4. Date: Tue, 26 Feb 2013 21:56:10 UTC
  5. Server: tfe
  6. Set-Cookie: guest_id=v1%3A136191577087881109; Domain=.twitter.com; Path=/; Expires=Thu, 26-Feb-2015 21:56:10 UTC
  7.  
  8. {"errors":[{"message":"Could not authenticate you","code":32}]}

This is a bit frustrating cause I didn't change the code since yesterday, and it's been running fine for weeks.

The request it sent was to api.twitter.com port 80:

  1. POST /1/direct_messages/new.json HTTP/1.1
  2. TE: deflate,gzip;q=0.3
  3. Connection: TE, close
  4. Authorization: OAuth oauth_consumer_key="xxxxxxxxxx",oauth_nonce="xxxxxxxxxx",oauth_signature="xxxxxxxxxx",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1361915770",oauth_token="114326949-xxxxxxxxxxx",oauth_version="1.0"
  5. Host: api.twitter.com
  6. User-Agent: Net::Twitter/3.13008 (Perl)
  7. Content-Length: 82
  8. Content-Type: application/x-www-form-urlencoded
  9. X-Twitter-Client: Perl Net::Twitter
  10. X-Twitter-Client-URL: http://search.cpan.org/dist/Net-Twitter/
  11. X-Twitter-Client-Version: 3.13008
  12.  
  13. text=some+message+text&user=SomeRecipientName

Can you give me some advice here?

Just to repeat, the same application can read my DMs fine, with the same OAuth keys and tokens, it just cannot send a DM.

Net::Twitter/3.13008 is the latest version of libnet-twitter-perl package on debian squeeze. It's using API 1. I've also tried hacking together the latest Net::Twitter from CPAN to see if the problem goes away with API 1.1 but it still produces the same error.

... and now I tried it again the problem has disappeared, on both the old and new clients. I repeat, the problem went away by itself ... which sorta means it was a failure on Twitter's end, not mine. Can you please confirm.