Missing extended_entities

twitter4j

#1

Recently I have noticed that we miss extended_entities in the response while we use https://api.twitter.com/1.1/statuses/update_with_media.json

Please look at the request and response below:

_13:18:11.051 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - Request:
13:18:11.054 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - POST --api_twitter_com-1.1-statuses-update_with_media.json
13:18:11.055 [main] DEBUG f_t_r_t_auth_OAuthAuthorization - OAuth base string: ***************
13:18:11.092 [main] DEBUG f_t_r_t_auth_OAuthAuthorization - OAuth signature: ***************
13:18:11.093 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - Authorization: ***************
13:18:11.093 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - X-Twitter-Client-Version: 4.0.5
13:18:11.093 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - X-Twitter-Client-URL: --twitter4j_org-en-twitter4j-4.0.5.xml
13:18:11.093 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - X-Twitter-Client: Twitter4J
13:18:11.093 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - User-Agent: twitter4j --twitter4j_org- -4.0.5
13:18:11.093 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - Accept-Encoding: gzip
13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“status”

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: text-plain; charset=UTF-8

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - #godips! @FnMFieldHockey took down Kean 2-0 yesterday to advance to the @NCAADIII Final Four for the first time sinab
13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“media[]”; filename=“download.jpeg”

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: image-jpeg

13:18:11.249 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“possibly_sensitive”

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: text-plain; charset=UTF-8

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - false
13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“include_entities”

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: text-plain; charset=UTF-8

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - true
13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“include_ext_alt_text”

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: text-plain; charset=UTF-8

13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - true
13:18:11.250 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“tweet_mode”

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: text-plain; charset=UTF-8

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - extended
13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase - ------Twitter4J-upload1511266691093–

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase -

13:18:12.570 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - Response:
13:18:12.571 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - date: Tue, 21 Nov 2017 12:18:12 GMT
13:18:12.571 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - HTTP-1.1 200 OK
13:18:12.582 [main] DEBUG f_t_r_twitter4j_HttpResponseImpl - {“in_reply_to_status_id_str”:null,“in_reply_to_status_id”:null,“possibly_sensitive”:false,“coordinates”:null,“created_at”:“Tue Nov 21 12:18:11 +0000 2017”,“truncated”:true,“in_reply_to_user_id_str”:null,“source”:"<a href=-"–www..io-" rel=-“nofollow-”> Social Media Management <–a>",“retweet_count”:0,“retweeted”:false,“geo”:null,“in_reply_to_screen_name”:null,“is_quote_status”:false,“entities”:{“urls”:[{“display_url”:“twitter_com-i-web-status-9-u2026”,“indices”:[117,140],“expanded_url”:"–twitter_com-i-web-status-932946241553649664",“url”:"–t.co-0WjRfIPJGb"}],“hashtags”:[{“indices”:[0,7],“text”:“godips”}],“user_mentions”:[{“indices”:[9,24],“screen_name”:“FnMFieldHockey”,“id_str”:“365630805”,“name”:“F&M Field Hockey”,“id”:365630805},{“indices”:[72,81],“screen_name”:“NCAADIII”,“id_str”:“467378905”,“name”:“NCAA Division III”,“id”:467378905}],“symbols”:[]},“id_str”:“932946241553649664”,“in_reply_to_user_id”:null,“favorite_count”:0,“id”:932946241553649664,“text”:"#godips! @FnMFieldHockey took down Kean 2-0 yesterday to advance to the @NCAADIII Final Four for the first time sin-u2026 --t.co-0WjRfIPJGb",“place”:null,“contributors”:null,“lang”:“en”,“user”:{“utc_offset”:null,“friends_count”:3,“profile_image_url_https”:"–abs.twimg.com-sticky-default_profile_images-default_profile_normal.png",“listed_count”:3,“profile_background_image_url”:"–abs.twimg.com-images-themes-theme1-bg.png",“default_profile_image”:true,“favourites_count”:17,“description”:“Hahah”,“created_at”:“Wed Jul 29 08:30:56 +0000 2015”,“is_translator”:false,“profile_background_image_url_https”:"–abs.twimg.com-images-themes-theme1-bg.png",“protected”:false,“screen_name”:“AlexSocia",“id_str”:“3393473477”,“profile_link_color”:“1DA1F2”,“is_translation_enabled”:false,“translator_type”:“none”,“id”:3393473477,“geo_enabled”:false,“profile_background_color”:“C0DEED”,“lang”:“en”,“has_extended_profile”:false,“profile_sidebar_border_color”:“C0DEED”,“profile_text_color”:“333333”,“verified”:false,“profile_image_url”:"–abs.twimg.com-sticky-default_profile_images-default_profile_normal.png",“time_zone”:null,“url”:null,“contributors_enabled”:false,“profile_background_tile”:false,“entities”:{“description”:{“urls”:[]}},“statuses_count”:468,“follow_request_sent”:false,“followers_count”:2,“profile_use_background_image”:true,“default_profile”:true,“following”:false,“name”:"Alex”,“location”:“Babakan Ciparay, West Java”,“profile_sidebar_fill_color”:“DDEEF6”,“notifications”:false},“favorited”:false}
_


#2

Firstly I would encourage you to switch to using the media/upload and statuses/update endpoints as update_with_media is clearly marked as deprecated.

Secondly, since you’re posting a longer Tweet, you need to use tweet_mode=extended to retrieve the complete object from the API.


#3

Hi @andypiper

Thanks for a quick reply.

I agree with your first point but the second is fulfilled in the example I gave you above.

13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Disposition: form-data; name=“tweet_mode”
13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientBase - Content-Type: text-plain; charset=UTF-8
13:18:11.253 [main] DEBUG f_t_r_twitter4j_HttpClientImpl - extended


#4

If you retrieve that Tweet using statuses/show with tweet_mode=extended it should return the complete object. I don’t think that would work as a POST parameter on update_with_media (which is no longer being maintained, and has not been since before extended Tweets were added).


#5

Agree with your last reply. I stop using deprecated api version you mentioned instead I am using a new one and it works.

THANKS A LOT FOR YOUR HELP @andypiper