Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Http",
"description": "Makes an HTTP request through the shared HttpService.",
"type": "object",
"examples": [
{
"title": "Fetch and store JSON",
"description": "Http can chain into any other action via OnSuccess/OnFailure. Here a public JSON endpoint's payload is stored under Context._catalog. Try changing the Url or Method (GET/POST/PUT/DELETE).",
"document": {
"PresentationType": "Button",
"Text": "Fetch a random cat fact",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "Http",
"Method": "GET",
"Url": "https://catfact.ninja/fact",
"OnSuccess": {
"Handler": "Alert",
"Theme": "Primary",
"Title": "Cat fact",
"Message": "{{ Value.fact }}"
},
"OnFailure": {
"Handler": "Alert",
"Theme": "Danger",
"Title": "Fetch failed",
"Message": "Could not reach the service."
}
}
}
}
],
"x-version": "1.0",
"required": [
"Handler",
"Url"
],
"properties": {
"Handler": {
"const": "Http"
},
"Url": {
"type": "string"
},
"Method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"DELETE",
"Get",
"Post",
"Put",
"Delete"
],
"default": "GET"
},
"ModelKey": {
"type": "string"
},
"Body": {},
"Value": {},
"OnSuccess": {
"$ref": "/schema/Actions/Action/1.0/index.json"
},
"OnFailure": {
"$ref": "/schema/Actions/Action/1.0/index.json"
}
},
"additionalProperties": false,
"x-icon": "<svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M3.5 12h17M12 3.5c2.5 2.4 2.5 14.6 0 17M12 3.5c-2.5 2.4-2.5 14.6 0 17\"/></svg>",
"$id": "/schema/Actions/Http/1.0/index.json",
"x-family": "Actions",
"x-name": "Http",
"x-source-package": "zero-schema"
}
Http can chain into any other action via OnSuccess/OnFailure. Here a public JSON endpoint's payload is stored under Context._catalog. Try changing the Url or Method (GET/POST/PUT/DELETE).
{
"PresentationType": "Button",
"Text": "Fetch a random cat fact",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "Http",
"Method": "GET",
"Url": "https://catfact.ninja/fact",
"OnSuccess": {
"Handler": "Alert",
"Theme": "Primary",
"Title": "Cat fact",
"Message": "{{ Value.fact }}"
},
"OnFailure": {
"Handler": "Alert",
"Theme": "Danger",
"Title": "Fetch failed",
"Message": "Could not reach the service."
}
}
}