Using the Microsoft Teams documentation here and following the hyperlink titled "Office 365 Connectors API Reference", which links to https://dev.outlook.com/Connectors/Reference but redirects to: https://docs.microsoft.com/en-us/outlook/actionable-messages/card-reference we end up with a page titled "Actionable message card reference".
This is a very useful document, listing all the fields we can use in a JSON string to create actionable contact cards, to push to various webhook connectors within the Office 365 ecosystem.
Using the JSON validator at https://messagecardplayground.azurewebsites.net/ I have constructed and tested the following:
{
"title":"New Office 365 Group: Success",
"text":"Performed by: someuser",
"themeColor":"00e600",
"sections":[
{
"title":"Section Title"
},
{
"facts":[
{
"name":"Name",
"value":"PRJ000001"
}
]
},
{
"potentialAction":[
{
"@context":"http://schema.org",
"@type":"ViewAction",
"name":"View Log",
"target":"something"
}
]
}
]
}
This is valid and renders correctly on that site, but when trying to send it to either an Office 365 Group Mailbox or a Team Channel, I get the error:
Bad payload received by generic incoming webhook.
If we take a simpler JSON construct like so, it works for both the O365 Group Mailbox and Team channel:
{
"title":"New Office 365 Group: Success",
"text":"Performed by: someuser",
"themeColor":"00e600",
"potentialAction":[
{
"@context":"http://schema.org",
"@type":"ViewAction",
"name":"View Log",
"target":[
"https://link/to/log"
]
}
]
}
It appears as though either the documentation is ahead of the service, or that the Groups and Teams webhook connectors don't support the full list of options and perhaps this only works for Outlook? Any ideas?
Thanks.