1

I have a json formatted message like this, I want to post this message into Slack with Slack postMessage API. Pasting the json string into text section would not work, how/where should I input that?

Thanks

biao
  • 311
  • 3
  • 10

1 Answers1

2

Using the link you posted, you'll need to generate an API token for your slack account. After that, choose a channel to post the message and put

*bold* `code` _italic_ ~strike~

next to the "text" field. The message should be posted in your slack channel.

Since you're using python, you can use the python slack api to do this. The code would then be

from slackclient import SlackClient
slack_client = SlackClient(API TOKEN)
slack_client.api_call("chat.postMessage", channel=CHANNEL ID, text="*bold* `code` _italic_ ~strike~", as_user=True)
Steven T
  • 83
  • 9
  • That's true, but I want to post the formatted text `{ "text": "*bold* `code` _italic_ ~strike~", "username": "markdownbot", "mrkdwn": true }`, for instance, in which I can enable/disable markdown feature. – biao Jul 26 '17 at 01:37