Create a rule
curl --request POST \
--url https://api.eka.care/protocol/workflow/rules \
--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"
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', 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")
.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");
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")
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": {
"id": "<string>",
"workflow_name": "<string>",
"version": 123,
"active": true
}
}{
"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
Create a rule
POST
/
protocol
/
workflow
/
rules
Create a rule
curl --request POST \
--url https://api.eka.care/protocol/workflow/rules \
--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"
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', 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")
.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");
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")
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": {
"id": "<string>",
"workflow_name": "<string>",
"version": 123,
"active": true
}
}{
"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?

