Embedded tweets in direct messages - strange URL



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:


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:


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?


Try adding full_text=true to the request


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


It’s standard for DMs these days


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.