Watcher Microsoft teams webhook

Hi,

I would like to send a notification to a Microsoft Teams webhook but I don't understand why this isn't workin, can someone help me please?

Here is my watch :

{
  "trigger": {
    "schedule": {
      "interval": "2m"
    }
  },
  "input": {
    "simple": {
      "summary": "Test Nom",
      "text": "test"
    }
  },
  "condition": {
    "always": {}
  },
  "actions": {
    "MS_TEAMS": {
      "webhook": {
        "scheme": "https",
        "host": "outlook.office.com",
        "port": 443,
        "method": "post",
        "path": "/webhook/XYZ",
        "params": {},
        "headers": {
          "content-type": "application/json"
        },
        "body": "{{#toJson}}ctx.payload.summary{{/toJson}}"
      }
    }
  }
}

And here is the response :

{
  "watch_id": "629a6c2e-74df-41eb-b3b4-6a95af79d1e6",
  "node": "QUApyNq4S5GyhHF-CuNjfg",
  "state": "executed",
  "status": {
    "state": {
      "active": true,
      "timestamp": "2019-10-16T10:05:39.087Z"
    },
    "last_checked": "2019-10-16T10:15:14.954Z",
    "last_met_condition": "2019-10-16T10:15:14.954Z",
    "actions": {
      "MS_TEAMS": {
        "ack": {
          "timestamp": "2019-10-16T10:05:39.087Z",
          "state": "awaits_successful_execution"
        },
        "last_execution": {
          "timestamp": "2019-10-16T10:15:14.954Z",
          "successful": false,
          "reason": "received [400] status code"
        }
      }
    },
    "execution_state": "executed",
    "version": -1
  },
  "trigger_event": {
    "type": "schedule",
    "triggered_time": "2019-10-16T10:15:14.954Z",
    "schedule": {
      "scheduled_time": "2019-10-16T10:15:14.685Z"
    }
  },
  "input": {
    "simple": {
      "summary": "Test Nom",
      "text": "test"
    }
  },
  "condition": {
    "always": {}
  },
  "metadata": {
    "name": "testJsonALaMano",
    "xpack": {
      "type": "json"
    }
  },
  "result": {
    "execution_time": "2019-10-16T10:15:14.954Z",
    "execution_duration": 112,
    "input": {
      "type": "simple",
      "status": "success",
      "payload": {
        "summary": "Test Nom",
        "text": "test"
      }
    },
    "condition": {
      "type": "always",
      "status": "success",
      "met": true
    },
    "actions": [
      {
        "id": "MS_TEAMS",
        "type": "webhook",
        "status": "failure",
        "reason": "received [400] status code",
        "webhook": {
          "request": {
            "host": "outlook.office.com",
            "port": 443,
            "scheme": "https",
            "method": "post",
            "path": "/webhook/XYZ",
            "headers": {
              "content-type": "application/json"
            },
            "body": "Test Nom"
          },
          "response": {
            "status": 400,
            "headers": {
              "date": [
                "Wed, 16 Oct 2019 10:15:15 GMT"
              ],
              "content-length": [
                "49"
              ],
              "expires": [
                "-1"
              ],
              "x-beserver": [
                "VI1PR07MB5053"
              ],
              "x-aspnet-version": [
                "4.0.30319"
              ],
              "x-proxy-backendserverstatus": [
                "400"
              ],
              "x-cafeserver": [
                "VI1PR04CA0090.EURPRD04.PROD.OUTLOOK.COM"
              ],
              "x-calculatedbetarget": [
                "VI1PR07MB5053.eurprd07.prod.outlook.com"
              ],
              "request-id": [
                "75d18af1-1482-4fdb-9fd5-c86cb73a9475"
              ],
              "pragma": [
                "no-cache"
              ],
              "x-msedge-ref": [
                "Ref A: 400B2560B3794E4BBEE7C1503D62762A Ref B: PAR02EDGE0517 Ref C: 2019-10-16T10:15:15Z"
              ],
              "x-feserver": [
                "VI1PR04CA0090"
              ],
              "x-powered-by": [
                "ASP.NET"
              ],
              "x-backendhttpstatus": [
                "400"
              ],
              "content-type": [
                "text/plain; charset=utf-8"
              ],
              "cache-control": [
                "no-cache"
              ]
            },
            "body": "Bad payload received by generic incoming webhook."
          }
        }
      }
    ]
  },
  "messages": []
}

The error message is returned by the endpoint, and it seems the format is not the desired one, so you may want to check the required format of the endpoint you are hitting.

Also, please do not open a second thread, when the first thread is not finished. This is a voluntarily driven forum and does not come with any SLAs, if you need something like that, go ahead and open a support issue.

Thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.