Working with status updates


#1

i wanna know
why dont the twitter API return success string upon posting a status

instead the update status API returns a long json code

this is the json code i was talking about:

[{“in_reply_to_user_id_str”:null,“contributors”:null,“favorited”:false,“user”:{“notifications”:false,“protected”:false,“is_translator”:false,“time_zone”:“Pacific Time (US & Canada)”,“favourites_count”:0,“profile_sidebar_border_color”:“C0DEED”,“followers_count”:1,“location”:null,“name”:“setanliar”,“follow_request_sent”:false,“following”:false,“verified”:false,“friends_count”:0,“profile_image_url_https”:“https://si0.twimg.com/sticky/default_profile_images/default_profile_5_normal.png",“screen_name”:“setanliar1”,“default_profile”:true,“geo_enabled”:false,“profile_use_background_image”:true,“utc_offset”:-28800,“url”:null,“description”:null,“profile_text_color”:“333333”,“profile_background_image_url”:“http://a0.twimg.com/images/themes/theme1/bg.png”,“listed_count”:0,“profile_link_color”:“0084B4”,“created_at”:"Tue Jun 14 06:05:08 +0000 2011”,“id_str”:“316945158”,“lang”:“en”,“profile_background_color”:“C0DEED”,“profile_image_url”:“http://a0.twimg.com/sticky/default_profile_images/default_profile_5_normal.png",“profile_background_tile”:false,“id”:316945158,“default_profile_image”:true,“show_all_inline_media”:false,“contributors_enabled”:false,“statuses_count”:69,“profile_background_image_url_https”:“https://si0.twimg.com/images/themes/theme1/bg.png”,“profile_sidebar_fill_color”:“DDEEF6”},“in_reply_to_status_id”:null,“geo”:null,“retweet_count”:0,“in_reply_to_screen_name”:null,“in_reply_to_user_id”:null,“coordinates”:null,“truncated”:false,“created_at”:"Tue Oct 11 05:31:10 +0000 2011”,“id_str”:“123631707076304896”,“retweeted”:false,“source”:"<a href=“http://www.lewatmana.com” rel=“nofollow”>prjct1</a>",“in_reply_to_status_id_str”:null,“place”:null,“id”:123631707076304896,“text”:“selasa hari ini”}]

I’m using EpiTwitter


#2

That is a success message for posting a status. You get the JSON representation (or an XML representation if that’s what you asked for) of the tweet you just issued along with a 200 OK HTTP status code.


#3

where’s the 200 OK http status code you’re talking about? i cannot find it on the response (JSON) returned after i send status update using Twitter API

what i mean to achieve is that how do i know whether it’s a success response or error response
you see, i use PHP to access the Twitter API to update status to my twitter account (more like news feeds)

when i get error message there is an [“error”]

for example
array(1) {
[0]=>
array(2) {
[“error”]=>
string(22) “Status is a duplicate.”
[“request”]=>
string(21) “/statuses/update.json”
}
}

with every successful tweet using the API there’s no [“success”] tag there, so there’s hard to determine in my php code whether the tweet was success or not

i hope i’m clear, my english is just adequate :slight_smile: