Compile a rule
curl --request POST \
--url https://api.eka.care/protocol/workflow/rules/compile \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"events": [
"<string>"
],
"name": "<string>",
"conditions": {
"field": "<string>",
"value": "<string>"
},
"tasks": [
{
"sa_id": "<string>",
"template_id": "<string>",
"title": "<string>",
"description": "<string>",
"payload": {},
"blocking": true,
"audience_keys": [
"<string>"
],
"estimate": "<string>",
"delay": "<string>",
"every": "<string>",
"due_in": "<string>",
"escalation": {
"after": "<string>",
"audience_keys": [
"<string>"
],
"title": "<string>"
}
}
],
"description": "<string>"
}
'import requests
url = "https://api.eka.care/protocol/workflow/rules/compile"
payload = {
"events": ["<string>"],
"name": "<string>",
"conditions": {
"field": "<string>",
"value": "<string>"
},
"tasks": [
{
"sa_id": "<string>",
"template_id": "<string>",
"title": "<string>",
"description": "<string>",
"payload": {},
"blocking": True,
"audience_keys": ["<string>"],
"estimate": "<string>",
"delay": "<string>",
"every": "<string>",
"due_in": "<string>",
"escalation": {
"after": "<string>",
"audience_keys": ["<string>"],
"title": "<string>"
}
}
],
"description": "<string>"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['<string>'],
name: '<string>',
conditions: {field: '<string>', value: '<string>'},
tasks: [
{
sa_id: '<string>',
template_id: '<string>',
title: '<string>',
description: '<string>',
payload: {},
blocking: true,
audience_keys: ['<string>'],
estimate: '<string>',
delay: '<string>',
every: '<string>',
due_in: '<string>',
escalation: {after: '<string>', audience_keys: ['<string>'], title: '<string>'}
}
],
description: '<string>'
})
};
fetch('https://api.eka.care/protocol/workflow/rules/compile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.eka.care/protocol/workflow/rules/compile")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"conditions\": {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"tasks\": [\n {\n \"sa_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"payload\": {},\n \"blocking\": true,\n \"audience_keys\": [\n \"<string>\"\n ],\n \"estimate\": \"<string>\",\n \"delay\": \"<string>\",\n \"every\": \"<string>\",\n \"due_in\": \"<string>\",\n \"escalation\": {\n \"after\": \"<string>\",\n \"audience_keys\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/protocol/workflow/rules/compile");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"conditions\": {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"tasks\": [\n {\n \"sa_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"payload\": {},\n \"blocking\": true,\n \"audience_keys\": [\n \"<string>\"\n ],\n \"estimate\": \"<string>\",\n \"delay\": \"<string>\",\n \"every\": \"<string>\",\n \"due_in\": \"<string>\",\n \"escalation\": {\n \"after\": \"<string>\",\n \"audience_keys\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/protocol/workflow/rules/compile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"conditions\": {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"tasks\": [\n {\n \"sa_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"payload\": {},\n \"blocking\": true,\n \"audience_keys\": [\n \"<string>\"\n ],\n \"estimate\": \"<string>\",\n \"delay\": \"<string>\",\n \"every\": \"<string>\",\n \"due_in\": \"<string>\",\n \"escalation\": {\n \"after\": \"<string>\",\n \"audience_keys\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"condition_text": "<string>",
"conductor_json": {
"name": "<string>",
"version": 123,
"ownerEmail": "<string>",
"description": "<string>",
"schemaVersion": 2,
"restartable": true,
"timeoutSeconds": 123,
"inputParameters": [
"<string>"
],
"tasks": [
{
"name": "<string>",
"taskReferenceName": "<string>",
"type": "SIMPLE",
"inputParameters": {
"bid": "<string>",
"rule_id": "<string>",
"event": "<string>",
"scope": "<string>",
"facts": "<string>",
"rule_version": "<string>",
"run_id": "<string>",
"index": 123,
"task": "<string>",
"kind": "<string>",
"delayed": true,
"iteration": "<string>"
},
"optional": true
}
],
"outputParameters": {}
}
}
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}Rules & catalog
Compile a rule
A preview: validates and compiles without saving.
POST
/
protocol
/
workflow
/
rules
/
compile
Compile a rule
curl --request POST \
--url https://api.eka.care/protocol/workflow/rules/compile \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"events": [
"<string>"
],
"name": "<string>",
"conditions": {
"field": "<string>",
"value": "<string>"
},
"tasks": [
{
"sa_id": "<string>",
"template_id": "<string>",
"title": "<string>",
"description": "<string>",
"payload": {},
"blocking": true,
"audience_keys": [
"<string>"
],
"estimate": "<string>",
"delay": "<string>",
"every": "<string>",
"due_in": "<string>",
"escalation": {
"after": "<string>",
"audience_keys": [
"<string>"
],
"title": "<string>"
}
}
],
"description": "<string>"
}
'import requests
url = "https://api.eka.care/protocol/workflow/rules/compile"
payload = {
"events": ["<string>"],
"name": "<string>",
"conditions": {
"field": "<string>",
"value": "<string>"
},
"tasks": [
{
"sa_id": "<string>",
"template_id": "<string>",
"title": "<string>",
"description": "<string>",
"payload": {},
"blocking": True,
"audience_keys": ["<string>"],
"estimate": "<string>",
"delay": "<string>",
"every": "<string>",
"due_in": "<string>",
"escalation": {
"after": "<string>",
"audience_keys": ["<string>"],
"title": "<string>"
}
}
],
"description": "<string>"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['<string>'],
name: '<string>',
conditions: {field: '<string>', value: '<string>'},
tasks: [
{
sa_id: '<string>',
template_id: '<string>',
title: '<string>',
description: '<string>',
payload: {},
blocking: true,
audience_keys: ['<string>'],
estimate: '<string>',
delay: '<string>',
every: '<string>',
due_in: '<string>',
escalation: {after: '<string>', audience_keys: ['<string>'], title: '<string>'}
}
],
description: '<string>'
})
};
fetch('https://api.eka.care/protocol/workflow/rules/compile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.eka.care/protocol/workflow/rules/compile")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"conditions\": {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"tasks\": [\n {\n \"sa_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"payload\": {},\n \"blocking\": true,\n \"audience_keys\": [\n \"<string>\"\n ],\n \"estimate\": \"<string>\",\n \"delay\": \"<string>\",\n \"every\": \"<string>\",\n \"due_in\": \"<string>\",\n \"escalation\": {\n \"after\": \"<string>\",\n \"audience_keys\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/protocol/workflow/rules/compile");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"conditions\": {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"tasks\": [\n {\n \"sa_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"payload\": {},\n \"blocking\": true,\n \"audience_keys\": [\n \"<string>\"\n ],\n \"estimate\": \"<string>\",\n \"delay\": \"<string>\",\n \"every\": \"<string>\",\n \"due_in\": \"<string>\",\n \"escalation\": {\n \"after\": \"<string>\",\n \"audience_keys\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/protocol/workflow/rules/compile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"<string>\"\n ],\n \"name\": \"<string>\",\n \"conditions\": {\n \"field\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"tasks\": [\n {\n \"sa_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"payload\": {},\n \"blocking\": true,\n \"audience_keys\": [\n \"<string>\"\n ],\n \"estimate\": \"<string>\",\n \"delay\": \"<string>\",\n \"every\": \"<string>\",\n \"due_in\": \"<string>\",\n \"escalation\": {\n \"after\": \"<string>\",\n \"audience_keys\": [\n \"<string>\"\n ],\n \"title\": \"<string>\"\n }\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"condition_text": "<string>",
"conductor_json": {
"name": "<string>",
"version": 123,
"ownerEmail": "<string>",
"description": "<string>",
"schemaVersion": 2,
"restartable": true,
"timeoutSeconds": 123,
"inputParameters": [
"<string>"
],
"tasks": [
{
"name": "<string>",
"taskReferenceName": "<string>",
"type": "SIMPLE",
"inputParameters": {
"bid": "<string>",
"rule_id": "<string>",
"event": "<string>",
"scope": "<string>",
"facts": "<string>",
"rule_version": "<string>",
"run_id": "<string>",
"index": 123,
"task": "<string>",
"kind": "<string>",
"delayed": true,
"iteration": "<string>"
},
"optional": true
}
],
"outputParameters": {}
}
}
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}Headers
Body
application/json
Was this page helpful?

