Actionable Message in Outlook Action.Http not working Workaround
Hello everyone,
we had used Actionable Messages (some call them Adaptive Cards) since two years ago.
In August this year (2024) our “Action.Http” stopped working.
If this sounds familiar, keep reading on.
I tried the Microsoft Support, but they could not figure what was the Problem.
After a lot of digging we found hints of the problem and a workaround.
We were sending actionable messages from our mail-server to an office365 mailbox and had a action.Http request back to our server.
What happened was, that no response was send back after august.
Our workaround uses Microsoft Power Automate to relay our request, because something on Microsoft’s Cloud Service stopped processing the requests in the actionable messages.
What you need is a Power Automate Premium License (around 14$ per Month) to use the Http Requests inside of Power Automate.
Here is, how it Worked for us.
1.) (Optional) create a service account that holds the Power Automate flows.
This step is optional, but it would be good to use an account that is not used by a employee.
Because if he quits and the Account is removed, you also lose the Power Automate flow.
2.) Create the Http relay flow
Go to https://make.powerautomate.com and login with the account that you want to use for the flow.
This account needs the Power Automate Premium License.
There are two ways to assign the license. When you try to save a flow that requires a license you get a error stating and an option to assign a license or you can assign a license before to the user, so that he can use the Power Automate flow.
Keep in mind, that you need at minimum a Power Automate free license to even see Power Automate in your “Apps” in the Browser if you log in to your account.
Here is an overview of the Power Automate flow.
The first step is a trigger “When an HTTP request is received”.
You can ether create it as an “Instant cloud flow” of an “automated cloud flow”. If you chose a “automated cloud flow” you have to use the “skip” button, because the http request trigger is not listed initially. You can add id afterwards, see the picture below.
Inside the trigger we will need to specify a JSON schema.
It is important to set “Who can Trigger The Flow” to “Anyone”
We found that one of the reasons that the “action.Http” is not working in outlook is that the api point or whatever it is, that normally relays the POST request inside an actionable message appears to be closed.
And Power Automate is the same if you do not set the Flow to “Anyone”. This was the “default” value before there update where they introduced the restriction options “Any user in my tenant” and “Specific user in my tenant”.
To bedder understand how it works let’s take a example.
In your actionable message, you want to send a POST request to your server “https://my-companyserver.com:5432/requests/” and the Request has a body of parameters that you want to send as an JSON
{
“Subject”: “Repair of Car”,
“Price”: “1234.00$”,
“Ticketnumber”: 123456
}
For the relay to work we have to send the original URL (https://my-companyserver.com:5432/requests/) and payload to our relay flow. For this example the POST request Body of the request that our flow receives would look like this.
{
“url”:”https://my-companyserver.com:5432/requests/“,
“ad_body”:{
“Subject”: “Repair of Car”,
“Price”: “1234.00$”,
“Ticketnumber”: 123456
}
}
With the body from the request, we can create a new request inside the flow and and send the response from that flow back to our actionable message to update the card or do whatever you want.
2.) Ad a “Compose” object
To use the body of the request as a variable in further steps we have to pass i throw a Data Operation Compose to “extract” it. There we chose ad_body to get the “original” body of the Action.Http from the actionable message.
3.) Add HTTP
Now we add our own request, that we build out of the “url” and “ad_body” and send them to our server. We add a “HTTP” Action ad define it. See pictures below.
We define the URL from the URL that we got from our Request and the Body from our Compose Step that “extracted” the ad_body from the request body.
DO not forget to add “ContentType” and “application/json“
It is a new request and we have to define the header. If you have more definitions that you need for your application to work, you configure them here. For us, we only need this one because all we do is send a JSON.
4.) Add response
in the last step we send the response from our own “HTTP” request to the actionable message.
To do this we add a “Response” to the flow.
Here we define, that the response will update the actionable message.
We send a status Code 200 and with the header “CARD-UPDATE-IN-BODY” is “true” the actionable message will be updated.
The “body” inside the “Response” is the updated actionable message that was generated on our server and send back as the body.
If you wand a minimal example of an working actionable message, here is the version i found.
{
“type”: “AdaptiveCard”,
“version”: “1.0”,
“originator”: “ff6b6746-a5f5-48d7-a363-95eb0504ffad”,
“body”: [
{
“type”: “TextBlock”,
“text”: “Hello world!”
}
],
“actions”: [
{
“type”: “Action.Http”,
“title”: “Click me!”,
“method”: “POST”,
“url”: “https://link-to-my-power-automate-flow“,
“body”: “{“Subject”:”Repair of Car”,”Price”:”1234.00$”,”Ticketnumber”:123456}”,
“headers”: [
{ “name”: “Content-Type”, “value”: “application/json” },
{ “name”: “Authorization”, “value”: “”}
]
}
]
}
If you get the error 401 inside Outlook when you click the actionable message you need to add
“headers”: [
{ “name”: “Content-Type”, “value”: “application/json” },
{ “name”: “Authorization”, “value”: “”}
]
The Power Automate Flow expects a token that is generated automatically by outlook, but we have to set the header manually because else outlook will mess it up and the POST request will have the wrong header and you will get a 401 error in response.
5.) Get Originator ID
Go to https://outlook.office.com/connectors/oam/publish/
If you can not open the URL or it can not be loaded, first go to https://outlook.office.com and then open a new tab in your Browser an go to the Link.One of the many Bugs we found on the way was that the side now uses a token created when you log into Outlook.office.com. If the Browser does not have this token you can no longer open the site directly.
Here you can create a connector for your Adaptive Cards.
When crating one you specify the email address of the sender, and the “Target URL”.
The “Target URL” is the URL form our Power Automate Flow that we crated, because we use the URL as an entry point for relaying.
And that is how our workaround was configured.
If you have questions fell free to leave a commend.
Hello everyone,we had used Actionable Messages (some call them Adaptive Cards) since two years ago.In August this year (2024) our “Action.Http” stopped working.If this sounds familiar, keep reading on.I tried the Microsoft Support, but they could not figure what was the Problem. After a lot of digging we found hints of the problem and a workaround.We were sending actionable messages from our mail-server to an office365 mailbox and had a action.Http request back to our server.What happened was, that no response was send back after august. Our workaround uses Microsoft Power Automate to relay our request, because something on Microsoft’s Cloud Service stopped processing the requests in the actionable messages.What you need is a Power Automate Premium License (around 14$ per Month) to use the Http Requests inside of Power Automate.Here is, how it Worked for us.1.) (Optional) create a service account that holds the Power Automate flows.This step is optional, but it would be good to use an account that is not used by a employee.Because if he quits and the Account is removed, you also lose the Power Automate flow. 2.) Create the Http relay flowGo to https://make.powerautomate.com and login with the account that you want to use for the flow.This account needs the Power Automate Premium License.There are two ways to assign the license. When you try to save a flow that requires a license you get a error stating and an option to assign a license or you can assign a license before to the user, so that he can use the Power Automate flow.Keep in mind, that you need at minimum a Power Automate free license to even see Power Automate in your “Apps” in the Browser if you log in to your account.Here is an overview of the Power Automate flow.The first step is a trigger “When an HTTP request is received”.You can ether create it as an “Instant cloud flow” of an “automated cloud flow”. If you chose a “automated cloud flow” you have to use the “skip” button, because the http request trigger is not listed initially. You can add id afterwards, see the picture below.Inside the trigger we will need to specify a JSON schema.It is important to set “Who can Trigger The Flow” to “Anyone”We found that one of the reasons that the “action.Http” is not working in outlook is that the api point or whatever it is, that normally relays the POST request inside an actionable message appears to be closed.And Power Automate is the same if you do not set the Flow to “Anyone”. This was the “default” value before there update where they introduced the restriction options “Any user in my tenant” and “Specific user in my tenant”.To bedder understand how it works let’s take a example.In your actionable message, you want to send a POST request to your server “https://my-companyserver.com:5432/requests/” and the Request has a body of parameters that you want to send as an JSON{ “Subject”: “Repair of Car”, “Price”: “1234.00$”, “Ticketnumber”: 123456}For the relay to work we have to send the original URL (https://my-companyserver.com:5432/requests/) and payload to our relay flow. For this example the POST request Body of the request that our flow receives would look like this.{ “url”:”https://my-companyserver.com:5432/requests/”, “ad_body”:{ “Subject”: “Repair of Car”, “Price”: “1234.00$”, “Ticketnumber”: 123456 }}With the body from the request, we can create a new request inside the flow and and send the response from that flow back to our actionable message to update the card or do whatever you want. 2.) Ad a “Compose” objectTo use the body of the request as a variable in further steps we have to pass i throw a Data Operation Compose to “extract” it. There we chose ad_body to get the “original” body of the Action.Http from the actionable message. 3.) Add HTTPNow we add our own request, that we build out of the “url” and “ad_body” and send them to our server. We add a “HTTP” Action ad define it. See pictures below.We define the URL from the URL that we got from our Request and the Body from our Compose Step that “extracted” the ad_body from the request body.DO not forget to add “ContentType” and “application/json”It is a new request and we have to define the header. If you have more definitions that you need for your application to work, you configure them here. For us, we only need this one because all we do is send a JSON.4.) Add responsein the last step we send the response from our own “HTTP” request to the actionable message.To do this we add a “Response” to the flow.Here we define, that the response will update the actionable message.We send a status Code 200 and with the header “CARD-UPDATE-IN-BODY” is “true” the actionable message will be updated.The “body” inside the “Response” is the updated actionable message that was generated on our server and send back as the body.If you wand a minimal example of an working actionable message, here is the version i found.{ “type”: “AdaptiveCard”, “version”: “1.0”, “originator”: “ff6b6746-a5f5-48d7-a363-95eb0504ffad”, “body”: [ { “type”: “TextBlock”, “text”: “Hello world!” } ], “actions”: [ { “type”: “Action.Http”, “title”: “Click me!”, “method”: “POST”, “url”: “https://link-to-my-power-automate-flow”, “body”: “{“Subject”:”Repair of Car”,”Price”:”1234.00$”,”Ticketnumber”:123456}”, “headers”: [ { “name”: “Content-Type”, “value”: “application/json” }, { “name”: “Authorization”, “value”: “”} ] } ]}If you get the error 401 inside Outlook when you click the actionable message you need to add”headers”: [ { “name”: “Content-Type”, “value”: “application/json” }, { “name”: “Authorization”, “value”: “”}]The Power Automate Flow expects a token that is generated automatically by outlook, but we have to set the header manually because else outlook will mess it up and the POST request will have the wrong header and you will get a 401 error in response.5.) Get Originator IDGo to https://outlook.office.com/connectors/oam/publish/If you can not open the URL or it can not be loaded, first go to https://outlook.office.com and then open a new tab in your Browser an go to the Link.One of the many Bugs we found on the way was that the side now uses a token created when you log into Outlook.office.com. If the Browser does not have this token you can no longer open the site directly.Here you can create a connector for your Adaptive Cards.When crating one you specify the email address of the sender, and the “Target URL”.The “Target URL” is the URL form our Power Automate Flow that we crated, because we use the URL as an entry point for relaying.And that is how our workaround was configured.If you have questions fell free to leave a commend. Read More