Re: Mentions via Incoming Webhook

14,212 views
Skip to first unread message

Dana Powers

unread,
Jan 4, 2014, 1:49:28 PM1/4/14
to jonatha...@gmail.com, slac...@googlegroups.com
have you tried:

<!everyone>

that's the suggestion from https://api.slack.com/docs/formatting

-Dana

On Fri, Jan 3, 2014 at 10:35 PM, <jonatha...@gmail.com> wrote:
Hello,

I'm using the node-slack module. I'm trying to send messages to a channel but I would like to mention participants (or @everyone); however when I send the @everyone tag as part of the message it doesn't render as a mention in the channel, just as common text, any idea how to achieve this?

Thank you.

--
You received this message because you are subscribed to the Google Groups "Slack API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slack-api+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jonathan Wiesel

unread,
Jan 4, 2014, 4:58:38 PM1/4/14
to Dana Powers, slac...@googlegroups.com
That works great for everyone; however I noticed that to mention a person it must be done by it's ID like <@U12345>, is there a way to make it by just the normal mention name?

Cal Henderson

unread,
Jan 6, 2014, 1:38:24 PM1/6/14
to slac...@googlegroups.com
On 1/4/2014 1:58 PM, Jonathan Wiesel wrote:
> That works great for everyone; however I noticed that to mention a
> person it must be done by it's ID like <@U12345>, is there a way to make
> it by just the normal mention name?

not currently - we need to start supporting it. we'll be adding various
option flags to webhooks (and the upcoming api method for posting
messages) to do a few things:

* linkify URLs
* linkify bare '@name'/'@everyone' etc. mentions
* optionally 'unfurl' media URLs (images, video)
* optionally 'unfurl' regular URLs (oembed/opengraph stuff)
* other things i've forgotten


--cal

Cal Henderson

unread,
Jan 13, 2014, 4:23:06 PM1/13/14
to slac...@googlegroups.com
On 1/6/2014 10:38 AM, Cal Henderson wrote:
> not currently - we need to start supporting it. we'll be adding various
> option flags to webhooks (and the upcoming api method for posting
> messages) to do a few things:
>
> * linkify URLs
> * linkify bare '@name'/'@everyone' etc. mentions
> * optionally 'unfurl' media URLs (images, video)
> * optionally 'unfurl' regular URLs (oembed/opengraph stuff)
> * other things i've forgotten

Incoming webhooks now support the 'parse' and 'link_names' arguments in
the updated formatting docs:

https://api.slack.com/docs/formatting
(See the section on 'Parsing modes')

--cal

Cal Henderson

unread,
Jan 13, 2014, 4:41:22 PM1/13/14
to slac...@googlegroups.com
On 1/13/2014 1:23 PM, Cal Henderson wrote:
> Incoming webhooks now support the 'parse' and 'link_names' arguments in
> the updated formatting docs:
>
> https://api.slack.com/docs/formatting
> (See the section on 'Parsing modes')

... but we just rolled it back because a dumb bug broke some existing
hooks. we'll roll out a fix later this week.

--cal

Myles Grant

unread,
Jan 14, 2014, 5:35:13 PM1/14/14
to slac...@googlegroups.com
And now this support has been re-rolled out.




--cal

--
You received this message because you are subscribed to the Google Groups "Slack API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slack-api+unsubscribe@googlegroups.com.

sels...@gmail.com

unread,
Apr 8, 2014, 9:35:43 AM4/8/14
to slac...@googlegroups.com, jonatha...@gmail.com

Hi guys,

Just trying to use the webhooks to notify me on a solarwinds alert (system monitoring)

if i use:

payload={"text": "My Text here"}

It works

If i try and fancy it up with color and formatting it fails:

payload = {"attachment" : [ {"color" : "red", "title" : "mytitle"}], "value" : "the message" }

any ideas?

also @myname doesnt seem to work. Thanks!

Paul Hammond

unread,
Apr 9, 2014, 2:12:53 PM4/9/14
to slac...@googlegroups.com
Hi!

There are a couple of things you need to change to get this to work. Firstly, colors need to be specified as hex codes, say "#ff0000". Secondly, right now your message is not actually part of the attachment. This should work:

payload={"text":"Message text", "attachments":[{"text":"Attachment text", "title": "Attachment title", "color":"#ff0000"}]}

Which will look like this:


It's worth adding a fallback property to the attachment, in case a client doesn't support attachments (for example, the IRC gateways): 

payload={"text":"Message text", "attachments":[{"text":"Attachment text", "title": "Attachment title", "color":"#ff0000", "fallback": "Attachment fallback" }]}


To get @names to link you need to add the link_names property:

payload={"text":"Hello @myname", "link_names": 1 }


Hope this helps!

Paul




For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages