tasks
Upsert task from transition
POST
/
api
/
v1
/
transitions
/
tasks
Upsert task from transition
curl --request POST \
--url https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_service": "<string>",
"entity_type": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"engine_request": "<string>",
"workflow_node_code": "<string>",
"required_permissions": [
{}
],
"priority": "MEDIUM",
"due_at": "2023-11-07T05:31:56Z",
"entity_reference": "<string>",
"node_preview_name": "<string>",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"node_instructions": "<string>"
}
'import requests
url = "https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks"
payload = {
"source_service": "<string>",
"entity_type": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"engine_request": "<string>",
"workflow_node_code": "<string>",
"required_permissions": [{}],
"priority": "MEDIUM",
"due_at": "2023-11-07T05:31:56Z",
"entity_reference": "<string>",
"node_preview_name": "<string>",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"node_instructions": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_service: '<string>',
entity_type: '<string>',
entity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
engine_request: '<string>',
workflow_node_code: '<string>',
required_permissions: [{}],
priority: 'MEDIUM',
due_at: '2023-11-07T05:31:56Z',
entity_reference: '<string>',
node_preview_name: '<string>',
assigned_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
node_instructions: '<string>'
})
};
fetch('https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_service' => '<string>',
'entity_type' => '<string>',
'entity_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'engine_request' => '<string>',
'workflow_node_code' => '<string>',
'required_permissions' => [
[
]
],
'priority' => 'MEDIUM',
'due_at' => '2023-11-07T05:31:56Z',
'entity_reference' => '<string>',
'node_preview_name' => '<string>',
'assigned_to' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'node_instructions' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks"
payload := strings.NewReader("{\n \"source_service\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"engine_request\": \"<string>\",\n \"workflow_node_code\": \"<string>\",\n \"required_permissions\": [\n {}\n ],\n \"priority\": \"MEDIUM\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"entity_reference\": \"<string>\",\n \"node_preview_name\": \"<string>\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"node_instructions\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_service\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"engine_request\": \"<string>\",\n \"workflow_node_code\": \"<string>\",\n \"required_permissions\": [\n {}\n ],\n \"priority\": \"MEDIUM\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"entity_reference\": \"<string>\",\n \"node_preview_name\": \"<string>\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"node_instructions\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_service\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"engine_request\": \"<string>\",\n \"workflow_node_code\": \"<string>\",\n \"required_permissions\": [\n {}\n ],\n \"priority\": \"MEDIUM\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"entity_reference\": \"<string>\",\n \"node_preview_name\": \"<string>\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"node_instructions\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"assigned": true,
"task": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"engine_request": "<string>",
"workflow_node_code": "<string>",
"node_preview_name": "<string>",
"node_instructions": "<string>",
"required_permissions_snapshot": [
{}
],
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assigned_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"due_at": "2023-11-07T05:31:56Z",
"source_service": "<string>",
"entity_type": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"assigned_to_user": {},
"escalation_level": 0
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required string length:
1 - 60Required string length:
1 - 60Required string length:
1 - 50Required string length:
2 - 100Minimum array length:
1Available options:
LOW, MEDIUM, HIGH, URGENT Maximum string length:
30Maximum string length:
120⌘I
Upsert task from transition
curl --request POST \
--url https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_service": "<string>",
"entity_type": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"engine_request": "<string>",
"workflow_node_code": "<string>",
"required_permissions": [
{}
],
"priority": "MEDIUM",
"due_at": "2023-11-07T05:31:56Z",
"entity_reference": "<string>",
"node_preview_name": "<string>",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"node_instructions": "<string>"
}
'import requests
url = "https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks"
payload = {
"source_service": "<string>",
"entity_type": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"engine_request": "<string>",
"workflow_node_code": "<string>",
"required_permissions": [{}],
"priority": "MEDIUM",
"due_at": "2023-11-07T05:31:56Z",
"entity_reference": "<string>",
"node_preview_name": "<string>",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"node_instructions": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_service: '<string>',
entity_type: '<string>',
entity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
engine_request: '<string>',
workflow_node_code: '<string>',
required_permissions: [{}],
priority: 'MEDIUM',
due_at: '2023-11-07T05:31:56Z',
entity_reference: '<string>',
node_preview_name: '<string>',
assigned_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
node_instructions: '<string>'
})
};
fetch('https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_service' => '<string>',
'entity_type' => '<string>',
'entity_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'engine_request' => '<string>',
'workflow_node_code' => '<string>',
'required_permissions' => [
[
]
],
'priority' => 'MEDIUM',
'due_at' => '2023-11-07T05:31:56Z',
'entity_reference' => '<string>',
'node_preview_name' => '<string>',
'assigned_to' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'node_instructions' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks"
payload := strings.NewReader("{\n \"source_service\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"engine_request\": \"<string>\",\n \"workflow_node_code\": \"<string>\",\n \"required_permissions\": [\n {}\n ],\n \"priority\": \"MEDIUM\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"entity_reference\": \"<string>\",\n \"node_preview_name\": \"<string>\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"node_instructions\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_service\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"engine_request\": \"<string>\",\n \"workflow_node_code\": \"<string>\",\n \"required_permissions\": [\n {}\n ],\n \"priority\": \"MEDIUM\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"entity_reference\": \"<string>\",\n \"node_preview_name\": \"<string>\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"node_instructions\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.capedigital.co.ke/assignment/api/v1/transitions/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_service\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"engine_request\": \"<string>\",\n \"workflow_node_code\": \"<string>\",\n \"required_permissions\": [\n {}\n ],\n \"priority\": \"MEDIUM\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"entity_reference\": \"<string>\",\n \"node_preview_name\": \"<string>\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"node_instructions\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"assigned": true,
"task": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"engine_request": "<string>",
"workflow_node_code": "<string>",
"node_preview_name": "<string>",
"node_instructions": "<string>",
"required_permissions_snapshot": [
{}
],
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assigned_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"due_at": "2023-11-07T05:31:56Z",
"source_service": "<string>",
"entity_type": "<string>",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"assigned_to_user": {},
"escalation_level": 0
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}