Posting multi-line messages

2,651 views
Skip to first unread message

Roustem Karimov

unread,
Apr 26, 2014, 4:12:13 PM4/26/14
to slac...@googlegroups.com
How could I post a multi-line message with WebHooks?

I can't find any information about this in Formatting docs: https://api.slack.com/docs/formatting

Paul Hammond

unread,
Apr 27, 2014, 1:19:43 AM4/27/14
to slac...@googlegroups.com
Hi Roustem,

You can embed newlines in JSON with a \n, so something like this works:

curl -X POST --data-urlencode 'payload={"text":"foo\nbar"}' https://my.slack.com/services/hooks/incoming-webhook?token=

Hope this helps!

Paul



On Sat, Apr 26, 2014 at 1:12 PM, Roustem Karimov <rou...@agilebits.com> wrote:
How could I post a multi-line message with WebHooks?

I can't find any information about this in Formatting docs: https://api.slack.com/docs/formatting

--
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/d/optout.

Roustem Karimov

unread,
Apr 27, 2014, 1:35:12 AM4/27/14
to slac...@googlegroups.com
Thank you, Paul!

The trick was to use --data-urlencode flag. I had --data there instead and it didn't work.

Roustem


--
You received this message because you are subscribed to a topic in the Google Groups "Slack API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/slack-api/YbDhr47cc4k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to slack-api+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages