712 строки
18 KiB
JSON
712 строки
18 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"version": "1.0",
|
|
"title": "CardPlatform",
|
|
"description": "Card Platform allows you to send Adaptive Cards to users. Can be used for actional content, such as approvals, forms capture, and general messaging. It supports templating and custom cards.",
|
|
"contact":{
|
|
"name":"CardPlatform Support",
|
|
"url" :"https://cardplatform.app/support",
|
|
"email":"support@cardplatform.app"
|
|
}
|
|
},
|
|
"x-ms-connector-metadata":[
|
|
{
|
|
"propertyName": "Website",
|
|
"propertyValue": "https://cardplatform.app/"
|
|
},
|
|
{
|
|
"propertyName": "Privacy policy",
|
|
"propertyValue": "https://cardplatform.app/privacy/"
|
|
},
|
|
{
|
|
"propertyName": "Categories",
|
|
"propertyValue": "Collaboration;Communication"
|
|
}
|
|
],
|
|
"host": "cardplatform.azure-api.net",
|
|
"basePath": "/",
|
|
"schemes": [
|
|
"https"
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"paths": {
|
|
"/sendmessage": {
|
|
"post": {
|
|
"description": "Sends an Adaptive Card as a message (no actions).",
|
|
"summary": "Send Message",
|
|
"operationId": "SendMessage",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "cardbody",
|
|
"in": "body",
|
|
"x-ms-summary": "Adaptive Card",
|
|
"description": "Adaptive Card",
|
|
"schema": {
|
|
"$ref": "#/definitions/MessageRequestSchema"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/CardResponseSchema"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sendcard": {
|
|
"x-ms-notification-content": {
|
|
"schema": {
|
|
"$ref": "#/definitions/ResponseSchema"
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "connectionId",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string",
|
|
"x-ms-visibility": "internal"
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"description": "Sends an Approval Adaptive Card, and returns the response with the choice and fields entered.",
|
|
"summary": "Send Card",
|
|
"x-ms-summary": "Send Card",
|
|
"operationId": "SendCard",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "cardbody",
|
|
"in": "body",
|
|
"description": "Adaptive Card",
|
|
"schema": {
|
|
"$ref": "#/definitions/CardRequestSchema"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"$ref": "#/responses/WebhookSubscribed"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/sendapproval": {
|
|
"x-ms-notification-content": {
|
|
"schema": {
|
|
"$ref": "#/definitions/ResponseSchema"
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "connectionId",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string",
|
|
"x-ms-visibility": "internal"
|
|
}
|
|
]
|
|
},
|
|
"post": {
|
|
"description": "Sends an Approval Adaptive Card, and returns the response with the choice and fields entered.",
|
|
"summary": "Send Approval",
|
|
"operationId": "SendApproval",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "cardbody",
|
|
"in": "body",
|
|
"x-ms-summary": "Adaptive Card",
|
|
"description": "Adaptive Card",
|
|
"schema": {
|
|
"$ref": "#/definitions/ApprovalRequestSchema"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"$ref": "#/responses/WebhookSubscribed"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PublicTemplates": {
|
|
"get": {
|
|
"description": "Retrieves the contents of a public template.",
|
|
"summary": "Get a public template",
|
|
"x-ms-summary": "Get a public template",
|
|
"operationId": "PublicTemplate_Get",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "path",
|
|
"in": "query",
|
|
"x-ms-summary": "Path of public template",
|
|
"description": "Path of public template",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"$ref": "#/definitions/TemplateListSchema"
|
|
},
|
|
"description": "Response"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PublicTemplates/Find": {
|
|
"post": {
|
|
"description": "Find a public template by analyzing the structure of your data.",
|
|
"summary": "Find a public template",
|
|
"operationId": "PublicTemplate_Find",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "data",
|
|
"in": "body",
|
|
"x-ms-summary": "Data",
|
|
"description": "Data",
|
|
"schema": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "object"
|
|
},
|
|
"description": "Response"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PublicTemplates/Transform": {
|
|
"post": {
|
|
"description": "Populates a public template with the data and returnes a fully populated Adaptive Card.",
|
|
"summary": "Transform public template",
|
|
"operationId": "PublicTemplate_Transform",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "path",
|
|
"in": "query",
|
|
"x-ms-summary": "Public Template Path",
|
|
"description": "Path of public template",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "data",
|
|
"in": "body",
|
|
"x-ms-summary": "Data",
|
|
"description": "Data",
|
|
"schema": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "object"
|
|
},
|
|
"description": "Response"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PublicTemplates/List": {
|
|
"get": {
|
|
"description": "Retrieves a list of all public templates.",
|
|
"summary": "List public templates",
|
|
"operationId": "PublicTemplate_GetAll",
|
|
"x-ms-visibility":"important",
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "object"
|
|
},
|
|
"description": "Response"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PrivateTemplates": {
|
|
"get": {
|
|
"description": "Retrieves a private template by name.",
|
|
"summary": "Get a private template",
|
|
"operationId": "PrivateTemplate_Get",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"x-ms-summary": "Name of private template",
|
|
"description": "Name of private template",
|
|
"type": "string",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "object"
|
|
},
|
|
"description": "Template"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete private template",
|
|
"description": "Removes a private template from the set of private templates.",
|
|
"operationId": "PrivateTemplates_Delete",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"x-ms-summary": "Template Name",
|
|
"description": "Template Name",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted"
|
|
},
|
|
"400": {
|
|
"description": "Template cannot be found"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create a private template",
|
|
"description": "Create a new private template.",
|
|
"operationId": "PrivateTemplates_Create",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"x-ms-summary": "Template Name",
|
|
"description": "Template Name",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"x-ms-summary": "Template",
|
|
"description": "Template",
|
|
"schema": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "object"
|
|
},
|
|
"description": "Template"
|
|
},
|
|
"400": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update a private template",
|
|
"description": "Updates the contents of a private template.",
|
|
"operationId": "PrivateTemplates_Update",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"x-ms-summary": "Template Name",
|
|
"description": "Template Name",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"x-ms-summary": "Template",
|
|
"description": "Template",
|
|
"schema": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "null"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PrivateTemplates/List": {
|
|
"get": {
|
|
"description": "Retrieves a list of all private templates.",
|
|
"summary": "List private templates",
|
|
"operationId": "PrivateTemplate_GetAll",
|
|
"x-ms-visibility":"important",
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"description": "Template"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/PrivateTemplates/Transform": {
|
|
"post": {
|
|
"description": "Populates a private template with the data and returnes a fully populated Adaptive Card.",
|
|
"summary": "Transform private template",
|
|
"operationId": "PrivateTemplate_Transform",
|
|
"x-ms-visibility":"important",
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"x-ms-summary": "Template Name",
|
|
"description": "Template Name",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "data",
|
|
"in": "body",
|
|
"x-ms-summary": "Data",
|
|
"description": "Data",
|
|
"schema": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"schema": {
|
|
"type": "object"
|
|
},
|
|
"description": "Response"
|
|
},
|
|
"default": {
|
|
"$ref": "#/responses/OperationFailed"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"MessageRequestSchema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"recipients": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Users to send the card to",
|
|
"x-ms-summary": "User's email",
|
|
"minItems": 1
|
|
},
|
|
"heading": {
|
|
"type": "string",
|
|
"description": "Card Heading",
|
|
"x-ms-summary": "Card Heading"
|
|
},
|
|
"instructions": {
|
|
"type": "string",
|
|
"description": "instructions",
|
|
"x-ms-summary": "Instructions"
|
|
},
|
|
"card": {
|
|
"type": "string",
|
|
"description": "Adaptive Card",
|
|
"x-ms-summary": "Adaptive Card"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"description": "ID to identify the card",
|
|
"x-ms-summary": "ID to identify the card"
|
|
},
|
|
"cardname": {
|
|
"type": "string",
|
|
"description": "Name of Card",
|
|
"x-ms-summary": "Name of Card"
|
|
}
|
|
},
|
|
"required": [
|
|
"card"
|
|
]
|
|
},
|
|
"CardRequestSchema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"notificationUrl": {
|
|
"x-ms-visibility": "Internal",
|
|
"x-ms-notification-url": true,
|
|
"type": "string"
|
|
},
|
|
"recipients": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Users to send the card to",
|
|
"x-ms-summary": "User's email",
|
|
"minItems": 1
|
|
},
|
|
"heading": {
|
|
"type": "string",
|
|
"description": "Card Heading",
|
|
"x-ms-summary": "Card Heading"
|
|
},
|
|
"instructions": {
|
|
"type": "string",
|
|
"description": "instructions",
|
|
"x-ms-summary": "Instructions"
|
|
},
|
|
"card": {
|
|
"type": "string",
|
|
"description": "Adaptive Card",
|
|
"x-ms-summary": "Adaptive Card"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"description": "ID to identify the card",
|
|
"x-ms-summary": "ID to identify the card"
|
|
},
|
|
"cardname": {
|
|
"type": "string",
|
|
"description": "Name of Card",
|
|
"x-ms-summary": "Name of Card"
|
|
},
|
|
"choiceType": {
|
|
"type": "string",
|
|
"description": "Type of choice",
|
|
"x-ms-summary": "Type of choice",
|
|
"enum": [
|
|
"ApproveAll",
|
|
"ApproveFirst"
|
|
]
|
|
},
|
|
"approvalChoice": {
|
|
"type": "string",
|
|
"description": "Default Choice for approve",
|
|
"x-ms-summary": "Default Choice for approve"
|
|
},
|
|
"rejectionChoice": {
|
|
"type": "string",
|
|
"description": "Default Choice for reject",
|
|
"x-ms-summary": "Default Choice for reject"
|
|
}
|
|
},
|
|
"required": [
|
|
"notificationUrl",
|
|
"card"
|
|
]
|
|
},
|
|
"ApprovalRequestSchema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"notificationUrl": {
|
|
"x-ms-visibility": "Internal",
|
|
"x-ms-notification-url": true,
|
|
"type": "string"
|
|
},
|
|
"template": {
|
|
"x-ms-visibility": "internal",
|
|
"type": "string",
|
|
"default": "GenericTemplate",
|
|
"description": "template",
|
|
"title": "template"
|
|
},
|
|
"recipients": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Users to send the card to",
|
|
"x-ms-summary": "User's email",
|
|
"minItems": 1
|
|
},
|
|
"heading": {
|
|
"type": "string",
|
|
"description": "Card Heading",
|
|
"x-ms-summary": "Card Heading"
|
|
},
|
|
"instructions": {
|
|
"type": "string",
|
|
"description": "instructions",
|
|
"x-ms-summary": "Instructions"
|
|
},
|
|
"actions": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": [
|
|
"Approve",
|
|
"Reject"
|
|
]
|
|
},
|
|
"choiceType": {
|
|
"type": "string",
|
|
"description": "Type of choice",
|
|
"x-ms-summary": "Type of choice",
|
|
"enum": [
|
|
"ApproveAll",
|
|
"ApproveFirst"
|
|
]
|
|
},
|
|
"approvalChoice": {
|
|
"type": "string",
|
|
"description": "Default Choice for approve",
|
|
"x-ms-summary": "Default Choice for approve",
|
|
"default": "Approve"
|
|
},
|
|
"rejectionChoice": {
|
|
"type": "string",
|
|
"description": "Default Choice for reject",
|
|
"x-ms-summary": "Default Choice for reject",
|
|
"default": "Reject"
|
|
}
|
|
},
|
|
"required": [
|
|
"notificationUrl",
|
|
"template"
|
|
]
|
|
},
|
|
"ResponseSchema": {
|
|
"type": "object",
|
|
"description": "Response from previous card",
|
|
"x-ms-summary": "Response",
|
|
"properties": {
|
|
"respondent": {
|
|
"type": "string"
|
|
},
|
|
"respondentName": {
|
|
"type": "string"
|
|
},
|
|
"respondentEmail": {
|
|
"type": "string"
|
|
},
|
|
"choice": {
|
|
"type": "string"
|
|
},
|
|
"comment": {
|
|
"type": "string"
|
|
},
|
|
"responseDate": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"TemplateListSchema": {
|
|
"type": "object",
|
|
"description": "Templates List",
|
|
"x-ms-summary": "Templates List",
|
|
"properties": {
|
|
"list": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"key": {
|
|
"type": "string"
|
|
},
|
|
"templates": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"file": {
|
|
"type": "string"
|
|
},
|
|
"fullPath": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CardResponseSchema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"parameters": {},
|
|
"responses": {
|
|
"WebhookSubscribed": {
|
|
"description": "Webhook Subscribed"
|
|
},
|
|
"WebhookUnsubscribed": {
|
|
"description": "Webhook Unsubscribed"
|
|
},
|
|
"OperationFailed": {
|
|
"description": "Operation Failed"
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"API Key": {
|
|
"type": "apiKey",
|
|
"in": "header",
|
|
"name": "Ocp-Apim-Subscription-Key"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"API Key": []
|
|
}
|
|
],
|
|
"tags": []
|
|
} |