Skip to content

Instantly share code, notes, and snippets.

@henrypoydar
Created December 10, 2015 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrypoydar/90c5dc01ea1e2eaa0551 to your computer and use it in GitHub Desktop.
Save henrypoydar/90c5dc01ea1e2eaa0551 to your computer and use it in GitHub Desktop.
For payloads sent to webdook urls generated by the Slack Button or in response to Slash Commands, text with @usernames or #channelnames is not linked when displayed in Slack, even with link_names set to 1 in the payload.
# Using an 'Incoming Webhook' url, the link_names directive works and #channel and @user are linked in payload text when displayed in Slack
curl -X POST --data-urlencode 'payload={"link_names": 1, "text": "This references the #general channel and the @hpoydar user using a webhook generated as an *Incoming Webhook* configuration", "attachments": [{"text": "Referencing the #general channel and the @hpoydar user in an attachment"}], "channel": "#demo", "username": "webhook-bot", "icon_emoji": ":large_blue_circle:"}' https://hooks.slack.com/services/INCOMING_WEBHOOK_URL
# Using a webhook url generated from the creation of a Slack Button, the link_names directive does not work and #channel and @user are not linked in payload text when displayed in Slack. Same goes for payloads returned in response to slash commands
curl -X POST --data-urlencode 'payload={"link_names": 1, "text": "This references the #general channel and the @hpoydar user using a webhook generated as from a *Slack Button* configuration", "attachments": [{"text": "Referencing the #general channel and the @hpoydar user in an attachment"}], "channel": "#demo", "username": "slack-button-bot", "icon_emoji": ":large_red_circle:"}' https://hooks.slack.com/services/SLASH_BUTTON_INCOMING_WEBHOOK_OR_SLASH_COMMAND
@henrypoydar
Copy link
Author

incoming-webhook-link-names

@henrypoydar
Copy link
Author

slack-button-integration-link-names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment