Search code examples
slack-apislack

How to disable Slack URL suggestion?


I want to send a direct message to a Slack user which contains a website link in its text. Here is the text,

var msgText="Find us on < http://www.google.com|Google>";

and then POST,

method: "POST", url: "https://slack.com/api/chat.postMessage",
body: { "token": slackBotToken, "as_user":true, "channel":"@UserId","text":msgText}

This is what I get on my Slack account,

enter image description here

I want to remove the URL suggestion, any idea how to do that?

Thanks


Solution

  • I got the answer from Slack Support, and I have verified that he is correct:

    Thanks for getting in touch, and sorry for the troubles with unfurling. It's quite hidden in our documentation (we'll make it more clear), but in order to completely prevent link unfurling within a particular message, you'll need to set both unfurl_links and unfurl_media to false.