Action Handlers
Action handlers enable card developers to provide action handling inside the manifest.
Currently only the submit action of Adaptive card can be handled.
Properties
Property | Type | Default Value | Required | Description | Schema Version | Since |
---|---|---|---|---|---|---|
url | string | Yes | The URL of the request. Relative paths like "data.json", "./data.json" and "../data.json" are going to be resolved relatively to the manifest base path. | 1.21.0 | 1.77 | |
mode | string | "cors" | No | The mode of the request. Possible values are "cors", "no-cors", "same-origin". | 1.21.0 | 1.77 |
method | string | "GET" | No | The HTTP method. Possible values are "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", and "HEAD". | 1.21.0 | 1.77 |
parameters | Object | No |
The request parameters to be sent to the server.
If the HTTP method is "POST", "PUT", "PATCH", or "DELETE" the parameters will be put as key/value pairs into the body of
the request.
If the method doesn't have an entity body, such as the "GET" or "HEAD" methods, the data is appended to
the URL.
Default encoding is application/x-www-form-urlencoded .
Also JSON is supported for the body encoding. If you need
it add a header Content-Type: application/json "
By default this property is a plain object that contains the form values of the Adaptive card. The keys of the object are the IDs of all form fields, the values are the fields values. Set this property if custom structure, keys, or values are needed. In this case the values of the form fields can be accessed by their IDs via the "form" model. This model contains all form fields. For more information see the Submit Action with Custom Payload sample. |
1.21.0 | 1.77 | |
headers | Object | No | The HTTP headers of the request. | 1.21.0 | 1.77 | |
withCredentials | boolean | No | Indicates whether cross-site requests should be made using credentials. | 1.21.0 | 1.77 |
Example
An example with a card which submits the form data to Northwind service:
{ "sap.card": { "configuration": { "actionHandlers": { "submit": { "url": "./NorthwindSvc/formData", "method": "POST" } } }, "type": "AdaptiveCard", "content": { "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ .... ], "actions": [ { "type": "Action.Submit", "title": "Send to backend" } ] } } }Try it Out