The API v2 cut tweet text to 270 characters, but real text length is more then 270 chars
Describe the bug The API v2 cut tweet text to 270 characters, but real text length is more then 270 chars. Tweet text contains more then 270 chars: https://x.com/Gurudev/status/1979249076425363763
To Reproduce Steps to reproduce the behavior:
-
get tweet by id. I use API v2, for this tweet: https://api.x.com/2/tweets?ids=1979249076425363763&expansions=attachments.media_keys&media.fields=url,preview_image_url,variants
-
result - text is cut to 270 chars: It is heartening to see 210 Naxalites lay down their arms - a step long overdue. The efforts of the Hon’ble Home Minister @AmitShah and @PMOIndia have paved the way for greater peace and prosperity. Congratulations to @PMOIndia and Hon’ble @AmitShah for this commendable
Expected behavior The result text should be: It is heartening to see 210 Naxalites lay down their arms - a step long overdue. The efforts of the Hon’ble Home Minister @AmitShah and @PMOIndia have paved the way for greater peace and prosperity. Congratulations to @PMOIndia and Hon’ble @AmitShah for this commendable achievement.
Additional context
I have asked devcommunity here: https://devcommunity.x.com/t/the-api-v2-cuts-tweet-text-to-270-characters-when-real-text-length-is-more-then-270-chars-280-chars/251379
The solution is
sadev23 X Staff:
Please use tweet.fields=note_tweet to get the complete tweet text
So now I use these urls params: const string urlParams = "&expansions=attachments.media_keys&tweet.fields=note_tweet&media.fields=url,preview_image_url,variants";
"https://api.x.com/2/tweets?ids=" + id + urlParams;
It works. May be it well be good to comment it in samples.