Skip to content

Instantly share code, notes, and snippets.

@Skitionek
Last active April 20, 2024 12:09
Show Gist options
  • Save Skitionek/c6e166193f6219048abc6ed22de2bf34 to your computer and use it in GitHub Desktop.
Save Skitionek/c6e166193f6219048abc6ed22de2bf34 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MessageCard",
"type": "object",
"required": [
"@type",
"@context"
],
"properties": {
"@type": {
"type": "string",
"const": "MessageCard"
},
"@context": {
"type": "string",
"const": "https://schema.org/extensions"
},
"correlationId": {
"type": "string",
"format": "uuid",
"description": "The correlationId property simplifies the process of locating logs for troubleshooting issues. We recommend that when sending an actionable card, your service should set and log a unique UUID in this property."
},
"expectedActors": {
"type": "array",
"items": {
"type": "string"
},
"description": "This contains a list of expected email addresses of the recipient for the action endpoint."
},
"originator": {
"type": "string",
"description": "Required when sent via email, not applicable when sent via connector. For actionable email, MUST be set to the provider ID generated by the Actionable Email Developer Dashboard."
},
"summary": {
"type": "string",
"description": "The summary property is typically displayed in the list view in Outlook, as a way to quickly determine what the card is all about.",
"minLength": 1
},
"themeColor": {
"type": "string",
"description": "Specifies a custom brand color for the card. The color will be displayed in a non-obtrusive manner."
},
"hideOriginalBody": {
"type": "boolean",
"description": "Only applies to cards in email messages. When set to true, causes the HTML body of the message to be hidden."
},
"title": {
"type": "string",
"description": "The title property is meant to be rendered in a prominent way, at the very top of the card. Use it to introduce the content of the card in such a way users will immediately know what to expect.",
"minLength": 1
},
"text": {
"type": "string",
"description": "The text property is meant to be displayed in a normal font below the card's title.",
"minLength": 1
},
"sections": {
"type": "array",
"items": {
"$ref": "#/definitions/Section"
}
},
"potentialAction": {
"type": "array",
"maxContains": 4,
"items": {
"$ref": "#/definitions/Action"
}
}
},
"definitions": {
"Section": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The title property of a section is displayed in a font that stands out while not as prominent as the card's title. It is meant to introduce the section and summarize its content, similarly to how the card's title property is meant to summarize the whole card."
},
"startGroup": {
"type": "boolean",
"description": "When set to true, the startGroup property marks the start of a logical group of information."
},
"activityImage": {
"type": "string",
"description": "Use activityImage to display the picture of an activity."
},
"activityTitle": {
"type": "string",
"description": "Use activityTitle to summarize what an activity did."
},
"activitySubtitle": {
"type": "string",
"description": "Use activitySubtitle to show additional details about the activity."
},
"activityText": {
"type": "string",
"description": "Use activityText to provide details about the activity."
},
"heroImage": {
"type": "string",
"description": "Use heroImage to make an image the centerpiece of your card."
},
"text": {
"type": "string",
"description": "The section's text property is very similar to the text property of the card. It can be used for the same purpose."
},
"facts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the fact."
},
"value": {
"type": "string",
"description": "The value of the fact."
}
}
},
"description": "Facts are a very important component of a section. They often contain the information that really matters to the user."
},
"images": {
"type": "array",
"items": {
"type": "string",
"description": "URLs of images."
},
"description": "The images property allows for the inclusion of a photo gallery inside a section."
},
"potentialAction": {
"type": "array",
"items": {
"$ref": "#/definitions/Action"
},
"description": "A collection of actions that can be invoked on this section."
}
}
},
"Action": {
"oneOf": [
{
"$ref": "#/definitions/OpenUriAction"
},
{
"$ref": "#/definitions/HttpPOSTAction"
},
{
"$ref": "#/definitions/ActionCardAction"
},
{
"$ref": "#/definitions/InvokeAddInCommandAction"
}
]
},
"OpenUriAction": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"const": "OpenUri"
},
"name": {
"type": "string",
"description": "The name property defines the text that will be displayed on screen for the action."
},
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"os": {
"type": "string",
"enum": [
"default",
"windows",
"iOS",
"android"
],
"description": "The target operating system for the action."
},
"uri": {
"type": "string",
"format": "uri",
"description": "The URI to open when the action is invoked."
}
},
"required": [
"os",
"uri"
]
},
"description": "A collection of name/value pairs that defines one URI per target operating system."
}
},
"required": [
"@type",
"name",
"targets"
]
},
"Header": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The header name."
},
"value": {
"type": "string",
"description": "The header value."
}
},
"required": [
"name",
"value"
]
},
"HttpPOSTAction": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"const": "HttpPOST"
},
"name": {
"type": "string",
"description": "The name property defines the text that will be displayed on screen for the action."
},
"target": {
"type": "string",
"format": "uri",
"description": "Defines the URL endpoint of the service that implements the action. Note: this URL must be accessible from the internet, you cannot use localhost."
},
"headers": {
"type": "array",
"items": {
"$ref": "#/definitions/Header"
},
"description": "A collection of Header objects representing a set of HTTP headers that will be emitted when sending the POST request to the target URL."
},
"body": {
"type": "string",
"description": "The body of the POST request."
},
"bodyContentType": {
"type": "string",
"enum": [
"application/json",
"application/x-www-form-urlencoded"
],
"description": "The MIME type of the body in the POST request. Valid values are application/json and application/x-www-form-urlencoded. If not specified, application/json is assumed."
}
},
"required": [
"@type",
"name"
]
},
"InputsCommon": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Uniquely identifies the input so it is possible to reference it in the body of an HttpPOST action."
},
"isRequired": {
"type": "boolean",
"description": "Indicates whether users are required to type a value before they are able to take an action that would take the value of the input as a parameter."
},
"title": {
"type": "string",
"description": "Defines a title for the input."
},
"value": {
"type": "string",
"description": "Defines the initial value of the input. For multi-choice inputs, value must be equal to the value property of one of the input's choices."
}
},
"required": [
"id",
"title"
]
},
"TextInput": {
"description": "Use this input type when you need users to provide free text, such as the response to a survey question.",
"allOf": [
{
"$ref": "#/definitions/InputsCommon"
},
{
"type": "object",
"properties": {
"isMultiline": {
"type": "boolean",
"description": "Indicates whether the text input should accept multiple lines of text."
},
"maxLength": {
"type": "integer",
"description": "Indicates the maximum number of characters that can be entered."
}
},
"required": [
"isMultiline",
"maxLength"
]
}
]
},
"DateInput": {
"description": "Use this input type when you need users to provide a date and or a time, such as for a task's due date.",
"allOf": [
{
"$ref": "#/definitions/InputsCommon"
},
{
"type": "object",
"properties": {
"includeTime": {
"type": "boolean",
"description": "Indicates whether the date input should allow for the selection of a time in addition to the date."
}
}
}
]
},
"MultichoiceInput": {
"description": "Use this input type when you need users to select from a list of pre-defined choices, such as a bug status, yes/no/maybe, etc.",
"allOf": [
{
"$ref": "#/definitions/InputsCommon"
},
{
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"display": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"display",
"value"
]
},
"description": "Defines the values that can be selected for the multichoice input."
},
"isMultiSelect": {
"type": "boolean",
"description": "If set to true, indicates that the user can select more than one choice. Default value is false."
},
"style": {
"type": "string",
"enum": [
"normal",
"expanded"
],
"description": "When isMultiSelect is false, setting the style property to expanded will instruct the host application to try and display all choices on the screen, typically using a set of radio buttons."
}
},
"required": [
"choices",
"isMultiSelect",
"style"
]
}
]
},
"Input": {
"oneOf": [
{
"$ref": "#/definitions/TextInput"
},
{
"$ref": "#/definitions/DateInput"
},
{
"$ref": "#/definitions/MultichoiceInput"
}
]
},
"ActionCardAction": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"const": "ActionCard"
},
"name": {
"type": "string",
"description": "The name property defines the text that will be displayed on screen for the action."
},
"inputs": {
"type": "array",
"items": {
"$ref": "#/definitions/Input"
},
"description": "The inputs property defines the various inputs that will be displayed in the action card's UI."
},
"actions": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/OpenUriAction"
},
{
"$ref": "#/definitions/HttpPOSTAction"
}
]
},
"description": "An array of Action objects, that can be either of type OpenUri or HttpPOST."
}
},
"required": [
"@type",
"name",
"inputs",
"actions"
]
},
"InvokeAddInCommandAction": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"const": "InvokeAddInCommand"
},
"name": {
"type": "string",
"description": "The name property defines the text that will be displayed on screen for the action."
},
"addInId": {
"type": "string",
"format": "uuid",
"description": "Specifies the add-in ID of the required add-in."
},
"desktopCommandId": {
"type": "string",
"description": "Specifies the ID of the add-in command button that opens the required task pane."
},
"initializationContext": {
"type": "object",
"description": "Optional. Developers may specify any valid JSON object in this field. The value is serialized into a string and made available to the add-in when the action is executed. This allows the action to pass initialization data to the add-in."
}
},
"required": [
"@type",
"name",
"addInId",
"desktopCommandId"
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment