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:
import json
import urllib2
webhook_url = "https://prod-145.westus.logic.azure.com:XXXX.XXXX"
payload = { "text": "Test" }
try:
response= system.net.httpPost(
url=webhook_url,
contentType="application/json",
data=json.dumps(payload),
timeout=10
)
print "HTTP Status Code:", response
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!