Dear all
I am at a loss and need help.
I try to send a webhook (with JSON data) from an external source to a teams channel. It works as I do get a message in the teams channel from the external source, however, I can't parse and use the JSON data trasmitted (to post it in the teams channel message).
The interesting data I want to use in the teams message is in the body/text object in the webhook - and optimally I would like to use the different objects within said data to design a message into the teams channel.
But I can't even put the whole JSON line in the message to begin with (let alone parse it for the individual pieces of information, which is the goal I am striving for).
Can you help me figure out what I am missing?
My Flow:
See attached file
My JSON configuration/data (somewhat obfuscated):
The original JSON info from the webhook (the "body" being the interesting part for me):
{
"headers": {
"Accept": "*/*",
"Host": "obfuscated",
"Max-Forwards": "10",
"X-ARR-LOG-ID": "obfuscated",
"CLIENT-IP": "obfuscated",
"DISGUISED-HOST": "obfuscated",
"X-SITE-DEPLOYMENT-ID": "obfuscated",
"WAS-DEFAULT-HOSTNAME": "obfuscated",
"X-Forwarded-Proto": "https",
"X-AppService-Proto": "https",
"X-ARR-SSL": "obfuscated",
"X-Forwarded-TlsVersion": "1.3",
"X-Forwarded-For": "obfuscated",
"X-Original-URL": "obfuscated",
"X-WAWS-Unencoded-URL": "obfuscated",
"Content-Length": "194",
"Content-Type": "application/json"
},
"body": {
"text": "<pre>{\n \"content\": \"obfuscated\".\n \"message\": \"\",\n \"time\": \"%%log_time%%\",\n \"username\": \"%%log_user%%\",\n \"source IP\": \"%%log_srcip%%\"\n}</pre>"
}
}
The JSON information in the "parse JSON" action:
raw inputs:
{
"content": {
"text": "<pre>{\n \"content\": \"obfuscated\".\n \"message\": \"\",\n \"time\": \"%%log_time%%\",\n \"username\": \"%%log_user%%\",\n \"source IP\": \"%%log_srcip%%\"\n}</pre>"
},
"schema": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"message": {
"type": "string"
},
"time": {
"type": "string"
},
"username": {
"type": "string"
},
"source IP": {
"type": "string"
}
}
}
}
raw ouputs:
{
"body": {
"text": "<pre>{\n \"content\": \"obfuscated\".\n \"message\": \"\",\n \"time\": \"%%log_time%%\",\n \"username\": \"%%log_user%%\",\n \"source IP\": \"%%log_srcip%%\"\n}</pre>"
}
}