Localized error messages


#1

Hi Api Team,

I would like to send curl request and replicate the response being seen in language other than :en, Is there a way to set headers in curl request and get localized error messages.

This is the request below that I am making but getting error message in english instead of tr, if I make the request again.

  • Connection #0 to host api.twitter.com left intact
    {“errors”:“sharing is not permissible for this status (Share validations failed)”}* Closing connection #0

[16:02:24] sulabh:~ $ curl --request ‘POST’ ‘https://api.twitter.com/1.1/statuses/retweet/349900306622083072.json’ --header ‘Authorization: OAuth oauth_consumer_key=“xxx”, oauth_nonce=“xxx”, oauth_signature=“xxx”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1372371177”, oauth_token=“xxx”, oauth_version=“1.0”’ --verbose -H ‘Content-Type: application/json; charset=UTF8’ -H ‘Accept-Language: tr-tr’

  • About to connect() to api.twitter.com port 443 (#0)
  • Trying 199.59.149.232…
  • connected
  • Connected to api.twitter.com (199.59.149.232) port 443 (#0)
  • SSLv3, TLS handshake, Client hello (1):
  • SSLv3, TLS handshake, Server hello (2):
  • SSLv3, TLS handshake, CERT (11):
  • SSLv3, TLS handshake, Server finished (14):
  • SSLv3, TLS handshake, Client key exchange (16):
  • SSLv3, TLS change cipher, Client hello (1):
  • SSLv3, TLS handshake, Finished (20):
  • SSLv3, TLS change cipher, Client hello (1):
  • SSLv3, TLS handshake, Finished (20):
  • SSL connection using RC4-SHA
  • Server certificate:
  • subject: C=US; ST=California; L=San Francisco; O=Twitter, Inc.; OU=Twitter Security; CN=api.twitter.com
  • start date: 2013-04-08 00:00:00 GMT
  • expire date: 2013-12-31 23:59:59 GMT
  • subjectAltName: api.twitter.com matched
  • issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa ©09; CN=VeriSign Class 3 Secure Server CA - G2
  • SSL certificate verify ok.

POST /1.1/statuses/retweet/349900306622083072.json HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
Host: api.twitter.com
Accept: /
Authorization: OAuth oauth_consumer_key=“xxx”, oauth_nonce=“xxx”, oauth_signature=“xxx”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1372371177”, oauth_token=“xxx”, oauth_version="1.0"
Content-Type: application/json; charset=UTF8
Accept-Language: tr-tr

< HTTP/1.1 200 OK
< cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
< content-length: 5306
< content-type: application/json; charset=utf-8
< date: Thu, 27 Jun 2013 23:11:13 GMT
< etag: “491010fa0859c137721fd99c72519f5b”
< expires: Tue, 31 Mar 1981 05:00:00 GMT
< last-modified: Thu, 27 Jun 2013 23:11:12 GMT
< pragma: no-cache
< server: tfe
< set-cookie: dnt=; domain=.twitter.com; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
< set-cookie: lang=en; path=/
< set-cookie: lang=en; path=/
< set-cookie: lang=en; path=/
< set-cookie: twid=u%3D87628083%7Cgwzy8KghzdyXzysW7kl3sgf%2BvZ4%3D; domain=.twitter.com; path=/; secure
< set-cookie: _twitter_sess=BAh7CDoMY3NyZl9pZCIlZGU4MTk1ZTVjMjBhMjkxZjg0ZDk0NDVhMGZhNzlm%250AOGQ6D2NyZWF0ZWRfYXRsKwh1peeHPwE6B2lkIiU2NjY5NjRmZDMxNTJlNzVk%250AODcyYzA0NmUxMDVhYmQ4ZA%253D%253D–ee794a4b3260a7f866f1b8c0cccd5452c514ce8a; domain=.twitter.com; path=/; HttpOnly
< set-cookie: guest_id=v1%3A137237467273695386; Domain=.twitter.com; Path=/; Expires=Sat, 27-Jun-2015 23:11:13 UTC
< status: 200 OK
< strict-transport-security: max-age=631138519
< vary: Accept-Encoding
< x-access-level: read-write-directmessages
< x-frame-options: SAMEORIGIN
< x-mid: 074cf9a03449c22e2aa387f1ca047153a9adf59a
< x-runtime: 0.29473
< x-transaction: 48b0d446ac3e3af4
< x-transaction-mask: a6183ffa5f8ca943ff1b53b5644ef114050bbdf3
<
{“in_reply_to_status_id”:null,“truncated”:false,“user”:{“profile_sidebar_fill_color”:“DDEEF6”,“name”:“Sulabh Jain”,“profile_background_image_url_https”:“https://si0.twimg.com/profile_background_images/324412603/mypicture.jpg",“default_profile_image”:false,“lang”:“en”,“geo_enabled”:true,“is_translator”:false,“screen_name”:“Sulabh_Jain”,“favourites_count”:2,“friends_count”:143,“statuses_count”:89,“id”:87628083,“profile_background_color”:“C0DEED”,“verified”:false,“notifications”:false,“profile_background_image_url”:“http://a0.twimg.com/profile_background_images/324412603/mypicture.jpg”,“profile_link_color”:“0084B4”,“following”:false,“utc_offset”:-18000,“created_at”:"Thu Nov 05 06:08:35 +0000 2009”,“default_profile”:false,“contributors_enabled”:false,“id_str”:“87628083”,“profile_use_background_image”:true,“profile_image_url”:“http://a0.twimg.com/profile_images/584253731/19_Dec_2009_015_opt_normal.jpg",“protected”:false,“profile_text_color”:“333333”,“description”:"Software Engineer, Groupon”,“profile_image_url_https”:“https://si0.twimg.com/profile_images/584253731/19_Dec_2009_015_opt_normal.jpg",“listed_count”:1,“profile_sidebar_border_color”:“C0DEED”,“time_zone”:"Eastern Time (US & Canada)”,“follow_request_sent”:false,“url”:null,“entities”:{“description”:{“urls”:[]}},“followers_count”:37,“profile_background_tile”:false,“location”:“Chicago, IL”},“in_reply_to_screen_name”:null,“possibly_sensitive”:false,“in_reply_to_status_id_str”:null,“geo”:null,“created_at”:“Thu Jun 27 23:11:12 +0000 2013”,“favorited”:false,“source”:"\u003Ca href=“http://ban.jo” rel=“nofollow”\u003EBanjo_Test\u003C/a\u003E",“in_reply_to_user_id_str”:null,“entities”:{“user_mentions”:[{“id”:317791278,“screen_name”:"_Williams_Stacy",“indices”:[3,19],“id_str”:“317791278”,“name”:“Belozeryshna”}],“hashtags”:[],“urls”:[{“expanded_url”:“http://4sq.com/1aNueLU",“url”:“http://t.co/sLQMKQnlnD”,“indices”:[63,85],“display_url”:“4sq.com/1aNueLU”}]},“place”:null,“id”:350390889966862337,“retweeted_status”:{“in_reply_to_status_id”:null,“truncated”:false,“user”:{“profile_sidebar_fill_color”:“DDFFCC”,“name”:“Belozeryshna”,“profile_background_image_url_https”:“https://si0.twimg.com/profile_background_images/887024043/c8112c3916cceab582f2c68139dd3c50.jpeg”,“default_profile_image”:false,“lang”:“ru”,“geo_enabled”:true,“is_translator”:false,“screen_name”:"_Williams_Stacy",“favourites_count”:17,“friends_count”:54,“statuses_count”:2867,“id”:317791278,“profile_background_color”:“A3002B”,“verified”:false,“notifications”:false,“profile_background_image_url”:“http://a0.twimg.com/profile_background_images/887024043/c8112c3916cceab582f2c68139dd3c50.jpeg”,“profile_link_color”:“3D38A1”,“following”:false,“utc_offset”:14400,“created_at”:"Wed Jun 15 13:49:20 +0000 2011”,“default_profile”:false,“contributors_enabled”:false,“id_str”:“317791278”,“profile_banner_url”:“https://pbs.twimg.com/profile_banners/317791278/1365794465",“profile_use_background_image”:true,“profile_image_url”:“http://a0.twimg.com/profile_images/3762255788/4a8db27f9f1aeda6559801987b107dab_normal.jpeg”,“protected”:false,“profile_text_color”:“333333”,“description”:"http://t.co/iEj7zjVJ2j http://t.co/QzReKXC1AS",“profile_image_url_https”:“https://si0.twimg.com/profile_images/3762255788/4a8db27f9f1aeda6559801987b107dab_normal.jpeg”,“listed_count”:0,“profile_sidebar_border_color”:“FFFFFF”,“time_zone”:“Moscow”,“follow_request_sent”:false,“url”:null,“entities”:{“description”:{“urls”:[{“display_url”:“vk.com/stacy_williams”,“url”:“http://t.co/iEj7zjVJ2j”,“expanded_url”:“http://vk.com/stacy_williams”,“indices”:[0,22]},{“display_url”:“stacy-williams.tumblr.com”,“url”:“http://t.co/QzReKXC1AS”,“expanded_url”:“http://stacy-williams.tumblr.com/”,“indices”:[23,45]}]}},“followers_count”:105,“profile_background_tile”:true,“location”:"\u041a\u0438\u0440\u043e\u0432"},“in_reply_to_screen_name”:null,“possibly_sensitive”:false,“in_reply_to_status_id_str”:null,“geo”:{“coordinates”:[37.91587749,29.07732491],“type”:“Point”},“created_at”:"Wed Jun 26 14:41:48 +0000 2013”,“favo* Connection #0 to host api.twitter.com left intact
rited”:false,“source”:"\u003Ca href=“http://foursquare.com” rel=“nofollow”\u003Efoursquare\u003C/a\u003E",“in_reply_to_user_id_str”:null,“entities”:{“user_mentions”:[],“urls”:[{“expanded_url”:“http://4sq.com/1aNueLU",“url”:“http://t.co/sLQMKQnlnD”,“indices”:[42,64],“display_url”:“4sq.com/1aNueLU”}],“hashtags”:[]},“place”:{“bounding_box”:{“coordinates”:[[[25.663883,35.817497],[44.822762,35.817497],[44.822762,42.109993],[25.663883,42.109993]]],“type”:“Polygon”},“full_name”:“Turkey”,“place_type”:“country”,“country”:“Turkey”,“url”:“http://api.twitter.com/1/geo/id/682c5a667856ef42.json”,“country_code”:“TR”,“id”:“682c5a667856ef42”,“attributes”:{},“name”:“Turkey”},“id”:349900306622083072,“coordinates”:{“coordinates”:[29.07732491,37.91587749],“type”:“Point”},“in_reply_to_user_id”:null,“retweet_count”:2,“text”:"I’m at C&H Hotel’s (Denizli, T\u00fcrkiye) http://t.co/sLQMKQnlnD",“retweeted”:true,“id_str”:“349900306622083072”,“contributors”:null},“coordinates”:null,“in_reply_to_user_id”:null,“retweet_count”:2,“text”:"RT @_Williams_Stacy: I’m at C&H Hotel’s (Denizli, T\u00fcrkiye) http://t.co/sLQMKQnlnD",“retweeted”:true,“id_str”:“350390889966862337”,"contributors”:null}* Closing connection #0

  • SSLv3, TLS alert, Client hello (1):