HttpPost Action fails with BadRequest

%3CLINGO-SUB%20id%3D%22lingo-sub-2213306%22%20slang%3D%22en-US%22%3EHttpPost%20Action%20fails%20with%20BadRequest%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2213306%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20use%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fwebhooks-and-connectors%2Fhow-to%2Fadd-incoming-webhook%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIncoming%20Webhook%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efeature%20to%20send%20notifications%20from%20our%20application%20backend%20to%20our%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Einternal%20Teams%20channel%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20some%20situations%20that%20require%20employee%20intervention%20(This%20is%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3Enot%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ea%20question%20about%20some%20kind%20of%20public%20Teams%20integration).%20I'm%20trying%20to%20add%20actionable%20notifications%20to%20our%20Teams%20workflow%20by%20adding%20an%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EHttpPost%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eaction%20to%20our%20messages%3A%3C%2FP%3E%3CPRE%3E%7B%0A%20%20%20%20%22%40type%22%3A%20%22MessageCard%22%2C%0A%20%20%20%20%22%40context%22%3A%20%22https%3A%2F%2Fschema.org%2Fextensions%22%2C%0A%20%20%20%20%22summary%22%3A%20%22Manual%20Verification%20Required%22%2C%0A%20%20%20%20%22themeColor%22%3A%20%22%232196F3%22%2C%0A%20%20%20%20%22text%22%3A%20%22%26lt%3Bmessage%20content%20here%26gt%3B%22%2C%0A%20%20%20%20%22title%22%3A%20%22Manual%20Verification%20Required%22%2C%0A%20%20%20%20%22potentialAction%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%40type%22%3A%20%22HttpPOST%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22Approve%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22target%22%3A%20%22https%3A%2F%2Four.application.host%2Fteams%2Fwebhook%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22body%22%3A%20%22verification.approve%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%5D%0A%7D%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20message%20arrives%20in%20teams%20properly%3A%3C%2FP%3E%3CDIV%20class%3D%22s-prose%20js-post-body%22%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22XHalf.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F264232iB09E364500A4DFA6%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22XHalf.png%22%20alt%3D%22XHalf.png%22%20%2F%3E%3C%2FSPAN%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUpon%20clicking%20the%20button%20though%2C%20immediately%20the%20following%20error%20message%20appears%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%3Awarning%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EFailed%20to%20send%3A%3C%2FSTRONG%3E%3CBR%20%2F%3EThere%20was%20a%20problem%20submitting%20your%20changes.%20Try%20again%20in%20a%20minute.%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EAfter%20scratching%20my%20head%2C%20I%20opened%20the%20Teams%20web%20app%20and%20checked%20the%20console%3A%3C%2FP%3E%3CPRE%3EPOST%20https%3A%2F%2Fteams.microsoft.com%2Fapi%2Fmt%2Femea%2Fbeta%2Fusers%2Fconnectors%2F19%3A0d89db468868447a8e526a258788b854%40thread.tacv2%3Bmessageid%3D1615721159117%2F1615721159117%2FexecuteAction%20400%0A%0A2021-03-14T11%3A30%3A20.322Z%20%5BO365ActionPaneController.makeHttpPOSTRequestForConnector()%5D%20Http%20invoke%20failed%3A%20%7B%0A%20%20%22data%22%3A%20%7B%0A%20%20%20%20%22errorCode%22%3A%20%22BadRequest%22%0A%20%20%7D%2C%0A%20%20%22status%22%3A%20400%2C%0A%20%20%22config%22%3A%20%7B%0A%20%20%20%20%22method%22%3A%20%22POST%22%2C%0A%20%20%20%20%22transformRequest%22%3A%20%5B%0A%20%20%20%20%20%20null%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22transformResponse%22%3A%20%5B%0A%20%20%20%20%20%20null%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22url%22%3A%20%22https%3A%2F%2Fteams.microsoft.com%2Fapi%2Fmt%2Femea%2Fbeta%2Fusers%2Fconnectors%2F19%3A0d89db468868447a8e526a258788b854%40thread.tacv2%3Bmessageid%3D1615721159117%2F1615721159117%2FexecuteAction%22%2C%0A%20%20%20%20%22data%22%3A%20%7B%0A%20%20%20%20%20%20%22inputParameters%22%3A%20%5B%5D%2C%0A%20%20%20%20%20%20%22actionId%22%3A%20%223c5b2184-bffb-4797-9bbd-03fe41e11a83%22%2C%0A%20%20%20%20%20%20%22potentialAction%22%3A%20%22%7B%5C%22%40type%5C%22%3A%5C%22HttpPOST%5C%22%2C%5C%22%40id%5C%22%3A%5C%223c5b2184-bffb-4797-9bbd-03fe41e11a83%5C%22%2C%5C%22name%5C%22%3A%5C%22Approve%5C%22%2C%5C%22target%5C%22%3A%5C%22https%3A%2F%2Four.appplication.host%2F.teams%2Fwebhook%5C%22%2C%5C%22headers%5C%22%3A%5B%5D%2C%5C%22body%5C%22%3A%5C%22verification.approve%5C%22%2C%5C%22bodyContentType%5C%22%3A%5C%22%5C%22%7D%22%2C%0A%20%20%20%20%20%20%22name%22%3A%20%22action%2Fconnector%22%2C%0A%20%20%20%20%20%20%22integrationId%22%3A%20%228urpi87b0u%22%2C%0A%20%20%20%20%20%20%22meta%22%3A%20%22%5C%22%7B%5C%5C%5C%22connectorSenderGuid%5C%5C%5C%22%3A%5C%5C%5C%22203a1e2c-26cc-47ca-83ae-be98f960b6b2%5C%5C%5C%22%2C%5C%5C%5C%22providerAccountUniqueId%5C%5C%5C%22%3Anull%2C%5C%5C%5C%22connectorConfigurationAlternateId%5C%5C%5C%22%3A%5C%5C%5C%228a43fac7aa1748688609de3602c9a4c5%5C%5C%5C%22%7D%5C%22%22%2C%0A%20%20%20%20%20%20%22clientInfo%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22locale%22%3A%20%22en-us%22%2C%0A%20%20%20%20%20%20%20%20%22country%22%3A%20%22us%22%2C%0A%20%20%20%20%20%20%20%20%22platform%22%3A%20%22Web%22%2C%0A%20%20%20%20%20%20%20%20%22clientVersion%22%3A%20%221415%2F1.0.0.2021030227%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%22X-Skypetoken%22%3A%20%22pii%22%2C%0A%20%20%20%20%20%20%22Authorization%22%3A%20%22pii%22%2C%0A%20%20%20%20%20%20%22Accept%22%3A%20%22application%2Fjson%2C%20text%2Fplain%2C%20*%2F*%22%2C%0A%20%20%20%20%20%20%22Content-Type%22%3A%20%22application%2Fjson%3Bcharset%3Dutf-8%22%2C%0A%20%20%20%20%20%20%22X-RingOverride%22%3A%20%22general%22%2C%0A%20%20%20%20%20%20%22x-ms-scenario-id%22%3A%20%22620%22%2C%0A%20%20%20%20%20%20%22x-ms-user-type%22%3A%20null%2C%0A%20%20%20%20%20%20%22x-ms-client-type%22%3A%20%22web%22%2C%0A%20%20%20%20%20%20%22x-ms-client-env%22%3A%20%22pckgsvc-prod-c1-euno-02%22%2C%0A%20%20%20%20%20%20%22x-ms-client-version%22%3A%20%221415%2F1.0.0.2021030227%22%2C%0A%20%20%20%20%20%20%22x-ms-session-id%22%3A%20%22694afe93-2218-14ab-fd16-d46edaf9fcc5%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22counter%22%3A%20%22ext_actionable_card_http_post%22%2C%0A%20%20%20%20%22geoRoutingLookupDuration%22%3A%200.014999997802078724%2C%0A%20%20%20%20%22decrementNetworkRequests%22%3A%20null%2C%0A%20%20%20%20%22hostName%22%3A%20%22teams.microsoft.com%22%2C%0A%20%20%20%20%22requestCreationDuration%22%3A%200.09000004455447197%2C%0A%20%20%20%20%22requestStartTime%22%3A%203355762.155000033%2C%0A%20%20%20%20%22responseStartTime%22%3A%203356549.715000001%2C%0A%20%20%20%20%22requestDuration%22%3A%20787.5649999482557%0A%20%20%7D%2C%0A%20%20%22statusText%22%3A%20%22%22%0A%7D%3C%2FPRE%3E%3CP%3ESo%20the%20only%20valuable%20information%20returned%20from%20the%20server%20seems%20to%20be%20the%20response%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%7B%22errorCode%22%3A%22BadRequest%22%7D.%20That's%20a%20little%20thin.%3C%2FP%3E%3CP%3EI%20tried%20different%20variations%20of%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebody%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eproperty%20-%20with%20quotes%2C%20without%2C%20with%20a%20content%20type%2C%20empty%20-%20no%20change.%3C%2FP%3E%3CP%3E%3CSTRONG%3EWhat%20do%20I%20have%20to%20do%20to%20get%20message%20actions%20working%3F%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FDIV%3E%3CDIV%20class%3D%22mt24%20mb12%22%3E%3CDIV%20class%3D%22post-taglist%20grid%20gs4%20gsy%20fd-column%22%3E%3CDIV%20class%3D%22grid%20ps-relative%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2213306%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EChat%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2213508%22%20slang%3D%22en-US%22%3ERe%3A%20HttpPost%20Action%20fails%20with%20BadRequest%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2213508%22%20slang%3D%22en-US%22%3EThank%20you%20for%20connecting%20to%20Microsoft%20Community%2C%20Level%205%20Experts%20are%20going%20to%20help%20you%20to%20fix%20your%20problem.%20Please%20Connect%20to%20our%20support%20no%20l~8.8.8~%E1%97%B1.%F0%90%90%9E.%F0%90%90%9E-O.2.2.2%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2213511%22%20slang%3D%22en-US%22%3ERe%3A%20HttpPost%20Action%20fails%20with%20BadRequest%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2213511%22%20slang%3D%22en-US%22%3E%CE%A4hank-you%20for%20Q%CF%85erying%20Microsoft%20Comm%CF%85nity%2C%20we%20are%20here%20to%20help%20with%20yo%CF%85%20problem%2C%20we%20are%20assigning%20Level%204%20Certified%20%CE%A4%E2%88%8Achnician%20to%20h%E2%88%8Alp%20with%20yo%CF%85r%20issue%20Pl%E2%88%8Aase%20caII%20on%20%CB%A6-8.8.8-%E1%97%B1.%F0%90%90%9E.%F0%90%90%9E-O.2.2.2%3C%2FLINGO-BODY%3E
Senior Member

We use the Incoming Webhook feature to send notifications from our application backend to our internal Teams channel in some situations that require employee intervention (This is not a question about some kind of public Teams integration). I'm trying to add actionable notifications to our Teams workflow by adding an HttpPost action to our messages:

{
    "@type": "MessageCard",
    "@context": "https://schema.org/extensions",
    "summary": "Manual Verification Required",
    "themeColor": "#2196F3",
    "text": "<message content here>",
    "title": "Manual Verification Required",
    "potentialAction": [
        {
            "@type": "HttpPOST",
            "name": "Approve",
            "target": "https://our.application.host/teams/webhook",
            "body": "verification.approve"
        }
    ]
}

 

The message arrives in teams properly:

 
 
XHalf.png

 

Upon clicking the button though, immediately the following error message appears:

:warning: Failed to send:
There was a problem submitting your changes. Try again in a minute.

After scratching my head, I opened the Teams web app and checked the console:

POST https://teams.microsoft.com/api/mt/emea/beta/users/connectors/19:0d89db468868447a8e526a258788b854@thread.tacv2;messageid=1615721159117/1615721159117/executeAction 400

2021-03-14T11:30:20.322Z [O365ActionPaneController.makeHttpPOSTRequestForConnector()] Http invoke failed: {
  "data": {
    "errorCode": "BadRequest"
  },
  "status": 400,
  "config": {
    "method": "POST",
    "transformRequest": [
      null
    ],
    "transformResponse": [
      null
    ],
    "url": "https://teams.microsoft.com/api/mt/emea/beta/users/connectors/19:0d89db468868447a8e526a258788b854@thread.tacv2;messageid=1615721159117/1615721159117/executeAction",
    "data": {
      "inputParameters": [],
      "actionId": "3c5b2184-bffb-4797-9bbd-03fe41e11a83",
      "potentialAction": "{\"@type\":\"HttpPOST\",\"@id\":\"3c5b2184-bffb-4797-9bbd-03fe41e11a83\",\"name\":\"Approve\",\"target\":\"https://our.appplication.host/.teams/webhook\",\"headers\":[],\"body\":\"verification.approve\",\"bodyContentType\":\"\"}",
      "name": "action/connector",
      "integrationId": "8urpi87b0u",
      "meta": "\"{\\\"connectorSenderGuid\\\":\\\"203a1e2c-26cc-47ca-83ae-be98f960b6b2\\\",\\\"providerAccountUniqueId\\\":null,\\\"connectorConfigurationAlternateId\\\":\\\"8a43fac7aa1748688609de3602c9a4c5\\\"}\"",
      "clientInfo": {
        "locale": "en-us",
        "country": "us",
        "platform": "Web",
        "clientVersion": "1415/1.0.0.2021030227"
      }
    },
    "headers": {
      "X-Skypetoken": "pii",
      "Authorization": "pii",
      "Accept": "application/json, text/plain, */*",
      "Content-Type": "application/json;charset=utf-8",
      "X-RingOverride": "general",
      "x-ms-scenario-id": "620",
      "x-ms-user-type": null,
      "x-ms-client-type": "web",
      "x-ms-client-env": "pckgsvc-prod-c1-euno-02",
      "x-ms-client-version": "1415/1.0.0.2021030227",
      "x-ms-session-id": "694afe93-2218-14ab-fd16-d46edaf9fcc5"
    },
    "counter": "ext_actionable_card_http_post",
    "geoRoutingLookupDuration": 0.014999997802078724,
    "decrementNetworkRequests": null,
    "hostName": "teams.microsoft.com",
    "requestCreationDuration": 0.09000004455447197,
    "requestStartTime": 3355762.155000033,
    "responseStartTime": 3356549.715000001,
    "requestDuration": 787.5649999482557
  },
  "statusText": ""
}

So the only valuable information returned from the server seems to be the response {"errorCode":"BadRequest"}. That's a little thin.

I tried different variations of the body property - with quotes, without, with a content type, empty - no change.

What do I have to do to get message actions working?

1 Reply

This question will be tracked from here.