1

I searched high and low but couldn't find a solution for this... I'm designing a basic slack message with link buttons and found that the button will not show in the message when the host contains an 'underscore'...

You can try below example here: https://api.slack.com/docs/messages/builder

{ "text": "some text here...", "attachments": [ { "title": "TITLE", "actions": [ { "type": "button", "text": "Link button", "url": "https://www.some-site.com" } ] } ] }

When you change www.some-site.com to www.some_site.com, the button disappears ...

Any suggestions on how to format the url so that the button shows up? According to the documentation, only the &, < and > characters need to be escaped, correct? I also tried encoding the URL, that didn't help either ... help?

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
mverkerk
  • 31
  • 1
  • 2
  • I'm having the same issue here... Did you find a solution? Nothing I do is working. So weird slack did this!!! – asafel Apr 05 '20 at 13:03

1 Answers1

0

This is a valid response from Slack, since www.some_site.com is not a valid URL.

You can not use underscores in hostnames, where hostname in your example is some-site. You can however use underscores in the label of a URL, so e.g. www_super.some-site.com should work.

Sources: - https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names - http://domainkeys.sourceforge.net/underscore.html

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • thx for the response - i tried your example `www_super.some-site.com` in the slack message-builder and it didn't work either ... i think it simply doesn't like underscores anywhere in the fqdn ... unfortunately, the internal server that i'm trying to link to has a hostname like this: `some_thing_interesting.int.company.com` ... :( – mverkerk Dec 13 '18 at 02:16
  • sorry to hear that it does not work either. Alternatively, you could consider a "bridge" endpoint, which routes all requests between Slack and the internal server with the weird host name – Erik Kalkoken Dec 13 '18 at 06:59