- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 01:25 PM
I ran across this yesterday and have tried to create a workflow in Microsoft Power Builder for Teams to create a new Webhook and it's not working.
The message I'm getting in Microsoft Teams:
Action Required: O365 connectors within Teams will be deprecated and notifications from this service will stop. Learn more about the timing and how the Workflows app provides a more flexible and secure experience. If you want to continue receiving these types of messages, you can use a workflow to post messages from a webhook request. Set up workflow
Putting the new webhook in Microsoft Team Spoke I'm getting the following error:
Error: 400. Message: {"error":{"code":"InvalidRequestContent","message":"The input body for trigger 'manual' of type 'Request' must be of type JSON, but was of type 'application/octet-stream'."}}. (Process Automation.0e9862431324030039a039ed9344b05f; line 5)
Does anyone know how to deal with this. We have a lot of flows that call into teams and this would suck to have it just stop working.
Any help would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 09:17 PM - edited 07-10-2024 10:53 PM
The reason for the above error is the webhook is expecting the request payload to be in JSON format.
Currently its sent in a different format. to achieve this you have to edit the flow action step Post Message and add Content Type: "application/json" in headers.
But the next issue you will face is MS Teams spoke is using connector cards (MessageCards) format for posting cards, which is in a different format from Adaptive cards in Teams workflows.
It Seems, we have to build a custom Flow Action which supports Adaptive card format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:54 AM
To get round this what I did was this:
1. Create a new account in Entra ID called ServiceNow.
2. Gave the account the roles needed to post to Teams.
3. Gave the account Cloud admin (I think. Might have bene full admin).
4. Approved the connections in ServiceNow using the new ServiceNow Entra account.
5. Removed the admin privs from the account.
This means that all the posts into teams now look like they are coming from a service account called ServiceNow. Which is better than it being an actual person.
YMMV

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 08:13 AM
This is true and smart, but I think a big issue we are missing here is that regardless. You have to make sure this user is a member of the team you're posting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 11:46 PM
Ah yes, forgot to mention that bit. That was step 6 when I couldn't get it to work!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 12:33 PM - edited 07-25-2024 12:41 PM
Simple custom fix (at your own risk) for refactoring MS Teams Connector.
If you utilize Microsoft Teams Connector webhooks for posting messages to channels you may have noticed that this warning message concerning their deprecation.
On July 23rd, Microsoft announced that they would be extending the retirement time line for existing Teams Connectors through December 2025 and Connector usage after December 31, 2024, existing Connectors will require additional action for them to work (you have to change the respective webhook URLs). Teams Connectors will be replaced by “Workflows”.
For those that are using the ServiceNow Microsoft Teams “Post a Message” Flow action from the Microsoft Teams Spoke for IntegrationHub and want to refactor their ServiceNow/MS Teams message posting pipeline using Workflows, below is a simple guide to achieve this, pending an update to the Spoke.
1. Set up Teams Workflow
- In your desired Teams Channel, open the channel settings and select Workflows
- Select Post to a channel when a webhook request is received
- In the workflow, open the first flow step and look at the HTTP POST URL (it should look something like https://prod-XXX...) and copy it for later. This is the endpoint we will be using in our ServiceNow Flow
2. Refactor ServiceNow Post a Message Microsoft Teams Flow Action
- Before running to simply replace the webhook URL input in the existing Flow Action, let’s take a look deeper look at it. we see that the action makes use of a script include called “MSTeamsMessageBuilder(). We see that it utilizes the generateBasicPayload method. In that function, we can see the structure of the payload
If we compare this payload to the payload shown in the Webhooks documentation, we see that they are not the same.
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"text": "Hello World!"
}
]
}
}
]
}
- Note: More advanced Adaptive Cards can be created be utilizing the Adaptive Card Designer and replacing the “content” property with the generated JSON in the Card Payload Editor in the Designer linked above.
In other words, the existing ServiceNow “Post a Message” Microsoft Teams flow action will not work in its current state. Not to worry!
- In Flow Designer, let’s create a custom Flow Action called “Post a Message to Microsoft Teams” (or whatever you’d like to call it.
- Set up the following Action Inputs
Add a new Script (or Payload Builder) step and call it “Build Payload” and set up the following input variables
Use the code below for the “Script” field:
(function execute(inputs, outputs) {
var payload = {
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [],
"actions": []
}
}
]
};
if (inputs.messageTitle != null) {
payload.attachments[0].content.body.push({
"type": "TextBlock",
"text": inputs.messageTitle,
"wrap": true,
"size": "Large",
"weight": "Bolder"
});
}
if (inputs.message != null) {
payload.attachments[0].content.body.push({
"type": "TextBlock",
"text": inputs.message
});
}
if (inputs.actionURL != null) {
payload.attachments[0].content.actions.push({
"type": "Action.OpenUrl",
"url": inputs.actionURL
});
if (inputs.actionName != null) {
payload.attachments[0].content.actions[0].title = inputs.actionName;
}
}
outputs.payload = JSON.stringify(payload);
})(inputs, outputs);
- Set up the following Output Variable
Add a new “REST” step and configure using details below
- Additionally, you can add error handling to this Flow Action if you’d like
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2025 04:33 AM - edited 03-27-2025 08:23 PM
Does this work??