I have made an app in slack where I want to fetch details of a document from an API and then display the preview of the same file in slack. I'm using Nodejs for the app but how do I get a document or link preview in slack while using Nodejs.
Thanks in advance!
For unfurling links/media when posting using chat.postMessage,
you can make use of below mentioned 'optional argurments'
unfurl_links Pass true to enable unfurling of primarily text-based content.
https://api.slack.com/methods/chat.postMessage#arg_unfurl_links
unfurl_media Pass false to disable unfurling of media content.
https://api.slack.com/methods/chat.postMessage#arg_unfurl_media