Embedded tweets in direct messages - strange URL

directmessages

#1

I just discovered an undocumented oddity with tweets embedded in direct messages. When reading DMs with the API, and the text of the DM is 140 characters or fewer, any embedded tweets in the DM show the usual Twitter status URL; for example:

https://twitter.com/[USERNAME]/status/[TWEET_ID]

But if the text of the DM is more than 140 characters, the URL for the tweet is in a format I haven’t seen before:

https://twitter.com/messages/[USER_ID]-[USER_ID]

The two numbers in this URL are the sender’s and recipient’s user ID, and entering this URL into a browser brings up either a login screen or the direct messages popup dialog.

The app I’m working on needs to get tweet URLs from these DMs, but if the text is longer than 140 characters, there appears to be no way to get that URL from the API. Is there a way to get the actual tweet URL from such a DM, or am I out of luck?


#2

Try adding full_text=true to the request


#3

Thank you so much! That fixed the problem. With this parameter included the tweet URLs are now standard status URLs.


#4

It’s standard for DMs these days


#5

I knew this was one of the fields returned with tweet_mode=extended, but I didn’t realize it was also possible to pass it as a parameter to the direct_messages/show request.