1

I have created an Actionable Message and registered a provider in Office365, which is approved for my organization. I'm sending the message via Microsoft Flow.

The message contains HttpPost actions in which I want to receive the response with am HTTP triggered Flow.

This is the JSON of the actionable message (I've removed the FLOW urls, and @'s are escaped.):

{
  "@@type": "MessageCard",
  "@@context": "http://schema.org/extensions",
  "originator": "<my_provider_id>",
  "summary": "Klanttevredenheidsonderzoek ",
  "title": "Bent u tevreden over de afhandeling van **melding 92138749247**",
  "text": "Graag horen we of u tevreden bent over deze melding",
  "themeColor": "E81123",
  "sections": [
    {
      "potentialAction": [
        {
          "@@type": "HttpPOST",
          "name": "Slecht!",
          "headers": [{ "Content-Type": "application/json" }],
          "target": "<flowurl>?<>flowurlparameters",
          "body": "Slecht!"
        },
        {
          "@@type": "HttpPOST",
          "name": "Goed!",
          "headers": [{ "Content-Type": "application/json" }],
          "target": "<flowurl>?<>flowurlparameters",
          "body": "Goed"
        }
      ]
    },
    {
      "startGroup": true,
      "title": "**Disclaimer**",
      "text": ". 2018"
    }
  ]
}

I have two problems:

  1. If I mail my own O365 account, I get the mail with the message showing correctly. However, the post buttons do not work correctly, and the link I see when I hover over the buttons is missing the URL parameters (which might be the cause it's not working). What could I be doing wrong, or is it still too early for this to work? How can I debug this?
  2. In the new SPFx O365Connectors webpart the HTTPPost actions are missing completely. The rest of the message is shown correctly. Are HTTPPost actions not supported yet? Or will they not be supported at all? Or is something wrong with what I'm doing..?
Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
JurgenW
  • 307
  • 2
  • 4
  • 18
  • Why are you escaping the `@`? I assume you're also escaping the query string in the URL? Also, have you tried using `bodyContentType` instead manually setting the `headers`? – Marc LaFleur Feb 27 '18 at 19:36
  • The @ is reserved in MS Flow, that's why you need to escape it. Your tip to encode the uri seems to have some effect. However, I can't get it right. If I do not encode the ? then no parameters are visible in outlook on the button. If I do encode the ? then the full encoded URL is shown in Outlook, but it doesnt work because it results in server error on the receiving Flow side (it expects the original link the Flow constructed itself which was already encoded but not the ?). – JurgenW Feb 28 '18 at 08:34
  • Did the `bodyContentType` have any effect? – Marc LaFleur Feb 28 '18 at 14:50
  • Seems to work the same as the custom header – JurgenW Feb 28 '18 at 16:35
  • Clicking the link in the outlook client gives me the following error in Fiddler: {"innerErrorCode":"ProviderException","innerErrorMessage":null,"authenticationUrl":null,"displayMessage":"The action could not be completed."} It's an http 500 error. it also does not work in the outlook web client btw. – JurgenW Mar 08 '18 at 10:12

2 Answers2

1

Microsoft has now added support for the scenario of catching HTTP Post operations from within an actionable email by Microsoft Flow. The key is to explicitly set the authorization header to an empty string. Below snippet uses the adaptive card schema v1.0 at http://adaptivecards.io/schemas/adaptive-card.json

"actions": [
                                        {
                                          "type": "Action.Http",
                                          "title": "Light",
                                          "method": "POST",
                                          "headers": [
                                            {
                                              "name": "Authorization",
                                              "value": ""
                                            }
                                          ],
                                          "url": "<a http triggered Flow URL>",
                                          "body": "{'currentRoom':'room1','currentState':'roomState1','action':null,'exit':null,'object':null,'objectAction':null,'userEmail':'someuser@somedomain.com'}"
                                        }
                                    ]
JurgenW
  • 307
  • 2
  • 4
  • 18
0

I received the following response from a Microsoft employee regarding this issue:

The reason it fails is because the logic app doesn’t allow sending Authorization header and it responds back 401 Unauthorized. We send Authorization header to identify that the request is from Office 365. The logic app works fine without Authorization header.

I will discuss this with the team and see if we can resolve this kind of scenario, and will update you on the status.

So for now it seems this scenario is not supported.

JurgenW
  • 307
  • 2
  • 4
  • 18