# How to send Message from Ignition to MS Teams via Workflows

**URL:** <https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [September 1, 2025, 9:53am UTC](https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304 "2025-09-01T09:53:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy.liu](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@andy.liu](https://forum.inductiveautomation.com/u/andy.liu)\
**Post date:** [September 1, 2025, 9:53am UTC](https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304/1 "2025-09-01T09:53:35Z")

</div>

Hello everyone,😀

I'm trying to send an alert from Ignition 8.1 to a Microsoft Teams chat. To do this, I'm using a **Teams workflow(send webhook alerts to the chat)** to get the webhook URL.

I've already successfully tested the webhook URL and the JSON payload using _Postman_, which works perfectly. This tells me the workflow itself is set up correctly.

However, when I run the script in the Ignition Script Console, nothing happens. There's no error message, and the `HTTP Status Code` output is completely blank. This suggests a network issue, but I'm looking for any specific settings or common pitfalls I might be missing on the Ignition Gateway side. Here is the script I'm using:

```python
import json
import urllib2

```

```python
webhook_url = "https://prod-145.westus.logic.azure.com:XXXX.XXXX"

```

```python
payload = { "text": "Test" }

```

```python
try:
    response= system.net.httpPost( 
        url=webhook_url,    
        contentType="application/json",
        data=json.dumps(payload),
        timeout=10
        )

```

```python
print "HTTP Status Code:", response

```

```python
except Exception as e:
    print "Connection failed!"
    print "error message:", str(e)

```

The output I get is: HTTP Status Code: (blank)

Any advice is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [September 1, 2025, 11:01am UTC](https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304/2 "2025-09-01T11:01:45Z")

</div>

> [@andy.liu](#):
>
> ```python
> import json
> import urllib2
> 
> ```

Not sure why you are importing these?

> [@andy.liu](#):
>
> `json.dumps(payload),`

Why aren't you using `system.util.jsonEncode()`

Can you post screenshots of your postman config?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 1, 2025, 11:25am UTC](https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304/3 "2025-09-01T11:25:31Z")

</div>

Also, you should probably be using `system.net.httpClient()`

> **[system.net.httpClient | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-net/system-net-httpClient)**
>
> Provides a general use object that can be used to send and receive HTTP requests.

---

<div class="post-metadata">

**Author:** ![andy.liu](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@andy.liu](https://forum.inductiveautomation.com/u/andy.liu)\
**Post date:** [September 1, 2025, 12:51pm UTC](https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304/5 "2025-09-01T12:51:32Z")

</div>

Thank you , I solved the problem by using `client = system.net.httpClient()`

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 1, 2025, 2:05pm UTC](https://forum.inductiveautomation.com/t/how-to-send-message-from-ignition-to-ms-teams-via-workflows/110304/6 "2025-09-01T14:05:32Z")

</div>

> [@andy.liu](#):
>
> I solved the problem

Be sure to follow the recommended reuse pattern for `system.net.httpClient` or your applicaton will suffer. (More of a requirement than a recommendation when you get past just testing.)
