# Is content-type "JSON" supported by Slack Module in Ansible 2.7.10 ?

**URL:** <https://forum.ansible.com/t/is-content-type-json-supported-by-slack-module-in-ansible-2-7-10/30479>\
**Category:** Ansible Developer\
**Created:** [June 3, 2019, 2:56pm UTC](https://forum.ansible.com/t/is-content-type-json-supported-by-slack-module-in-ansible-2-7-10/30479 "2019-06-03T14:56:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jourdan\_West](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@Jourdan\_West](https://forum.ansible.com/u/Jourdan_West)\
**Post date:** [June 3, 2019, 2:56pm UTC](https://forum.ansible.com/t/is-content-type-json-supported-by-slack-module-in-ansible-2-7-10/30479/1 "2019-06-03T14:56:43Z")

</div>

Hello,

I’m attempting to send a message to Slack channel using Ansible’s Slack module as follows:

`local_action: module: slack channel: ... token: ... msg: [{"type":"section","text":{"type":"mrkdwn","text":"App deployment started for commit <https://github.com | 1ehe2e38> to production"}}]`

The JSON payload makes it to the channel but is rendered as plain text:

`[{'type': 'section', 'text': {'type': 'mrkdwn', 'text': 'App deployment started for commit 1ehe2e38 to production'}}]`

The goal is to have it rendered as follows

`App deployment started for commit [1ehe2e38](http://someurl/) to production`

where the commit is a hyperlink to GitHub.

I’m able to send this JSON and have it be properly formatter using Slack’s Block Kit builder as seen [here](https://api.slack.com/tools/block-kit-builder?blocks=%5B%7B%22type%22%3A%22section%22%2C%22text%22%3A%7B%22type%22%3A%22mrkdwn%22%2C%22text%22%3A%22App%20deployment%20started%20for%20commit%20%3Chttps%3A%2F%2Fgithub.com%20%7C%201ece2e38%20%3E%20to%20production%22%7D%7D%5D).

Question: Is content-type “JSON” supported by Slack Module in Ansible 2.7.10 ? If it is, what am I doing incorrectly ?

---

<div class="post-metadata">

**Author:** ![Tony\_G](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@Tony\_G](https://forum.ansible.com/u/Tony_G)\
**Post date:** [June 3, 2019, 3:32pm UTC](https://forum.ansible.com/t/is-content-type-json-supported-by-slack-module-in-ansible-2-7-10/30479/2 "2019-06-03T15:32:33Z")

</div>

Hi Jourdan,

This type of question is better suited for the forum: [https://groups.google.com/forum/#!forum/ansible-project](https://groups.google.com/forum/#!forum/ansible-project) This distribution list is for Ansible Dev.

In your example you want to pass the message, not the payload, slack module takes care of that for you already. See this example and a screenshot of the results: [https://gist.github.com/tonyskapunk/731da1c2be33ebda307153cdcda982f6](https://gist.github.com/tonyskapunk/731da1c2be33ebda307153cdcda982f6)

The Ansible documentation for the slack module ([https://docs.ansible.com/ansible/latest/modules/slack\_module.html](https://docs.ansible.com/ansible/latest/modules/slack_module.html)) points to the Slack documentation which includes how to link messages: [https://api.slack.com/docs/message-formatting#linking\_to\_urls](https://api.slack.com/docs/message-formatting#linking_to_urls)

Hope that helps.

---

<div class="post-metadata">

**Author:** ![Jourdan\_West](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@Jourdan\_West](https://forum.ansible.com/u/Jourdan_West)\
**Post date:** [June 3, 2019, 3:52pm UTC](https://forum.ansible.com/t/is-content-type-json-supported-by-slack-module-in-ansible-2-7-10/30479/3 "2019-06-03T15:52:14Z")

</div>

That did it! Thank you.

Feel free to delete/move this message since it’s not in the right placed.
