Search code examples
twitter

How to get the full direct message using twitter REST API


I tried to use the following endpoints to get the contents of one or more direct messages:

  • direct_messages.json
  • direct_messages/show.json?id={id}

The messages are returned correctly, the only problem is that the text of the message is truncated to ~140 chars, and the final part of the message is substituted with a shortened link ( t.co ), that when open points to https://twitter.com/messages/(\d+)-(\d+)

The link can't be opened using the REST API, and I have no idea how to retrieve the last part of the message.


Solution

  • you just have to add full_text=true as stated here: https://twittercommunity.com/t/removing-the-140-character-limit-from-direct-messages/41348