cURL
curl --request POST \
--url https://api.smartbills.io/v1/businesses/{businessId}/workflows \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"entityType": "<string>",
"priority": 123,
"enabled": true,
"effectiveFrom": "2023-11-07T05:31:56Z",
"effectiveTo": "2023-11-07T05:31:56Z",
"tags": "<string>",
"conditions": [
{}
],
"actions": [
{
"id": 123,
"order": 123
}
],
"triggers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventType": "<string>",
"scheduleExpression": "<string>",
"eventPattern": "<string>",
"enabled": true,
"configuration": {}
}
],
"steps": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"order": 123,
"isRequired": true,
"timeoutMinutes": 123,
"maxRetryAttempts": 123,
"retryDelaySeconds": 123,
"dependsOnSteps": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"successConditions": [
{}
],
"failureConditions": [
{}
],
"preConditions": [
{}
],
"actions": [
{
"id": 123,
"order": 123
}
],
"eventExpectations": [
{
"eventType": "<string>",
"eventPattern": "<string>",
"timeoutMinutes": 123,
"isRequired": true,
"expectedPayload": {}
}
],
"onSuccess": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [
{}
],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": true,
"stopReason": "<string>"
},
"onFailure": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [
{}
],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": true,
"stopReason": "<string>"
},
"onTimeout": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [
{}
],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": true,
"stopReason": "<string>"
},
"configuration": {},
"isActive": true,
"timers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"delayMinutes": 123,
"actions": [
{
"id": 123,
"order": 123
}
],
"conditions": [
{}
],
"isRecurring": true,
"maxRecurrences": 123,
"isActive": true
}
],
"canRunInParallel": true,
"priority": 123,
"tags": [
"<string>"
]
}
],
"jsonConfig": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"businessId": 123,
"createdByUserId": 123
}
'import requests
url = "https://api.smartbills.io/v1/businesses/{businessId}/workflows"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"entityType": "<string>",
"priority": 123,
"enabled": True,
"effectiveFrom": "2023-11-07T05:31:56Z",
"effectiveTo": "2023-11-07T05:31:56Z",
"tags": "<string>",
"conditions": [{}],
"actions": [
{
"id": 123,
"order": 123
}
],
"triggers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventType": "<string>",
"scheduleExpression": "<string>",
"eventPattern": "<string>",
"enabled": True,
"configuration": {}
}
],
"steps": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"order": 123,
"isRequired": True,
"timeoutMinutes": 123,
"maxRetryAttempts": 123,
"retryDelaySeconds": 123,
"dependsOnSteps": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"successConditions": [{}],
"failureConditions": [{}],
"preConditions": [{}],
"actions": [
{
"id": 123,
"order": 123
}
],
"eventExpectations": [
{
"eventType": "<string>",
"eventPattern": "<string>",
"timeoutMinutes": 123,
"isRequired": True,
"expectedPayload": {}
}
],
"onSuccess": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [{}],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": True,
"stopReason": "<string>"
},
"onFailure": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [{}],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": True,
"stopReason": "<string>"
},
"onTimeout": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [{}],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": True,
"stopReason": "<string>"
},
"configuration": {},
"isActive": True,
"timers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"delayMinutes": 123,
"actions": [
{
"id": 123,
"order": 123
}
],
"conditions": [{}],
"isRecurring": True,
"maxRecurrences": 123,
"isActive": True
}
],
"canRunInParallel": True,
"priority": 123,
"tags": ["<string>"]
}
],
"jsonConfig": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"businessId": 123,
"createdByUserId": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
entityType: '<string>',
priority: 123,
enabled: true,
effectiveFrom: '2023-11-07T05:31:56Z',
effectiveTo: '2023-11-07T05:31:56Z',
tags: '<string>',
conditions: [{}],
actions: [{id: 123, order: 123}],
triggers: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
eventType: '<string>',
scheduleExpression: '<string>',
eventPattern: '<string>',
enabled: true,
configuration: {}
}
],
steps: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
order: 123,
isRequired: true,
timeoutMinutes: 123,
maxRetryAttempts: 123,
retryDelaySeconds: 123,
dependsOnSteps: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
successConditions: [{}],
failureConditions: [{}],
preConditions: [{}],
actions: [{id: 123, order: 123}],
eventExpectations: [
{
eventType: '<string>',
eventPattern: '<string>',
timeoutMinutes: 123,
isRequired: true,
expectedPayload: {}
}
],
onSuccess: {
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>',
conditionalBranches: [
{
conditions: [{}],
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>'
}
],
stopWorkflow: true,
stopReason: '<string>'
},
onFailure: {
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>',
conditionalBranches: [
{
conditions: [{}],
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>'
}
],
stopWorkflow: true,
stopReason: '<string>'
},
onTimeout: {
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>',
conditionalBranches: [
{
conditions: [{}],
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>'
}
],
stopWorkflow: true,
stopReason: '<string>'
},
configuration: {},
isActive: true,
timers: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
delayMinutes: 123,
actions: [{id: 123, order: 123}],
conditions: [{}],
isRecurring: true,
maxRecurrences: 123,
isActive: true
}
],
canRunInParallel: true,
priority: 123,
tags: ['<string>']
}
],
jsonConfig: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
businessId: 123,
createdByUserId: 123
})
};
fetch('https://api.smartbills.io/v1/businesses/{businessId}/workflows', 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.smartbills.io/v1/businesses/{businessId}/workflows",
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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'entityType' => '<string>',
'priority' => 123,
'enabled' => true,
'effectiveFrom' => '2023-11-07T05:31:56Z',
'effectiveTo' => '2023-11-07T05:31:56Z',
'tags' => '<string>',
'conditions' => [
[
]
],
'actions' => [
[
'id' => 123,
'order' => 123
]
],
'triggers' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'eventType' => '<string>',
'scheduleExpression' => '<string>',
'eventPattern' => '<string>',
'enabled' => true,
'configuration' => [
]
]
],
'steps' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'order' => 123,
'isRequired' => true,
'timeoutMinutes' => 123,
'maxRetryAttempts' => 123,
'retryDelaySeconds' => 123,
'dependsOnSteps' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'successConditions' => [
[
]
],
'failureConditions' => [
[
]
],
'preConditions' => [
[
]
],
'actions' => [
[
'id' => 123,
'order' => 123
]
],
'eventExpectations' => [
[
'eventType' => '<string>',
'eventPattern' => '<string>',
'timeoutMinutes' => 123,
'isRequired' => true,
'expectedPayload' => [
]
]
],
'onSuccess' => [
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>',
'conditionalBranches' => [
[
'conditions' => [
[
]
],
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>'
]
],
'stopWorkflow' => true,
'stopReason' => '<string>'
],
'onFailure' => [
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>',
'conditionalBranches' => [
[
'conditions' => [
[
]
],
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>'
]
],
'stopWorkflow' => true,
'stopReason' => '<string>'
],
'onTimeout' => [
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>',
'conditionalBranches' => [
[
'conditions' => [
[
]
],
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>'
]
],
'stopWorkflow' => true,
'stopReason' => '<string>'
],
'configuration' => [
],
'isActive' => true,
'timers' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'delayMinutes' => 123,
'actions' => [
[
'id' => 123,
'order' => 123
]
],
'conditions' => [
[
]
],
'isRecurring' => true,
'maxRecurrences' => 123,
'isActive' => true
]
],
'canRunInParallel' => true,
'priority' => 123,
'tags' => [
'<string>'
]
]
],
'jsonConfig' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'businessId' => 123,
'createdByUserId' => 123
]),
CURLOPT_HTTPHEADER => [
"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.smartbills.io/v1/businesses/{businessId}/workflows"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"entityType\": \"<string>\",\n \"priority\": 123,\n \"enabled\": true,\n \"effectiveFrom\": \"2023-11-07T05:31:56Z\",\n \"effectiveTo\": \"2023-11-07T05:31:56Z\",\n \"tags\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"triggers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventType\": \"<string>\",\n \"scheduleExpression\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"enabled\": true,\n \"configuration\": {}\n }\n ],\n \"steps\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"order\": 123,\n \"isRequired\": true,\n \"timeoutMinutes\": 123,\n \"maxRetryAttempts\": 123,\n \"retryDelaySeconds\": 123,\n \"dependsOnSteps\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"successConditions\": [\n {}\n ],\n \"failureConditions\": [\n {}\n ],\n \"preConditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"eventExpectations\": [\n {\n \"eventType\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"timeoutMinutes\": 123,\n \"isRequired\": true,\n \"expectedPayload\": {}\n }\n ],\n \"onSuccess\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onFailure\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onTimeout\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"configuration\": {},\n \"isActive\": true,\n \"timers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"delayMinutes\": 123,\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"conditions\": [\n {}\n ],\n \"isRecurring\": true,\n \"maxRecurrences\": 123,\n \"isActive\": true\n }\n ],\n \"canRunInParallel\": true,\n \"priority\": 123,\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"jsonConfig\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"businessId\": 123,\n \"createdByUserId\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.smartbills.io/v1/businesses/{businessId}/workflows")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"entityType\": \"<string>\",\n \"priority\": 123,\n \"enabled\": true,\n \"effectiveFrom\": \"2023-11-07T05:31:56Z\",\n \"effectiveTo\": \"2023-11-07T05:31:56Z\",\n \"tags\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"triggers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventType\": \"<string>\",\n \"scheduleExpression\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"enabled\": true,\n \"configuration\": {}\n }\n ],\n \"steps\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"order\": 123,\n \"isRequired\": true,\n \"timeoutMinutes\": 123,\n \"maxRetryAttempts\": 123,\n \"retryDelaySeconds\": 123,\n \"dependsOnSteps\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"successConditions\": [\n {}\n ],\n \"failureConditions\": [\n {}\n ],\n \"preConditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"eventExpectations\": [\n {\n \"eventType\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"timeoutMinutes\": 123,\n \"isRequired\": true,\n \"expectedPayload\": {}\n }\n ],\n \"onSuccess\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onFailure\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onTimeout\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"configuration\": {},\n \"isActive\": true,\n \"timers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"delayMinutes\": 123,\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"conditions\": [\n {}\n ],\n \"isRecurring\": true,\n \"maxRecurrences\": 123,\n \"isActive\": true\n }\n ],\n \"canRunInParallel\": true,\n \"priority\": 123,\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"jsonConfig\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"businessId\": 123,\n \"createdByUserId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartbills.io/v1/businesses/{businessId}/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"entityType\": \"<string>\",\n \"priority\": 123,\n \"enabled\": true,\n \"effectiveFrom\": \"2023-11-07T05:31:56Z\",\n \"effectiveTo\": \"2023-11-07T05:31:56Z\",\n \"tags\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"triggers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventType\": \"<string>\",\n \"scheduleExpression\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"enabled\": true,\n \"configuration\": {}\n }\n ],\n \"steps\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"order\": 123,\n \"isRequired\": true,\n \"timeoutMinutes\": 123,\n \"maxRetryAttempts\": 123,\n \"retryDelaySeconds\": 123,\n \"dependsOnSteps\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"successConditions\": [\n {}\n ],\n \"failureConditions\": [\n {}\n ],\n \"preConditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"eventExpectations\": [\n {\n \"eventType\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"timeoutMinutes\": 123,\n \"isRequired\": true,\n \"expectedPayload\": {}\n }\n ],\n \"onSuccess\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onFailure\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onTimeout\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"configuration\": {},\n \"isActive\": true,\n \"timers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"delayMinutes\": 123,\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"conditions\": [\n {}\n ],\n \"isRecurring\": true,\n \"maxRecurrences\": 123,\n \"isActive\": true\n }\n ],\n \"canRunInParallel\": true,\n \"priority\": 123,\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"jsonConfig\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"businessId\": 123,\n \"createdByUserId\": 123\n}"
response = http.request(request)
puts response.read_bodyWorkflow
Post v1businesses workflows
POST
/
v1
/
businesses
/
{businessId}
/
workflows
cURL
curl --request POST \
--url https://api.smartbills.io/v1/businesses/{businessId}/workflows \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"entityType": "<string>",
"priority": 123,
"enabled": true,
"effectiveFrom": "2023-11-07T05:31:56Z",
"effectiveTo": "2023-11-07T05:31:56Z",
"tags": "<string>",
"conditions": [
{}
],
"actions": [
{
"id": 123,
"order": 123
}
],
"triggers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventType": "<string>",
"scheduleExpression": "<string>",
"eventPattern": "<string>",
"enabled": true,
"configuration": {}
}
],
"steps": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"order": 123,
"isRequired": true,
"timeoutMinutes": 123,
"maxRetryAttempts": 123,
"retryDelaySeconds": 123,
"dependsOnSteps": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"successConditions": [
{}
],
"failureConditions": [
{}
],
"preConditions": [
{}
],
"actions": [
{
"id": 123,
"order": 123
}
],
"eventExpectations": [
{
"eventType": "<string>",
"eventPattern": "<string>",
"timeoutMinutes": 123,
"isRequired": true,
"expectedPayload": {}
}
],
"onSuccess": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [
{}
],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": true,
"stopReason": "<string>"
},
"onFailure": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [
{}
],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": true,
"stopReason": "<string>"
},
"onTimeout": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [
{}
],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": true,
"stopReason": "<string>"
},
"configuration": {},
"isActive": true,
"timers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"delayMinutes": 123,
"actions": [
{
"id": 123,
"order": 123
}
],
"conditions": [
{}
],
"isRecurring": true,
"maxRecurrences": 123,
"isActive": true
}
],
"canRunInParallel": true,
"priority": 123,
"tags": [
"<string>"
]
}
],
"jsonConfig": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"businessId": 123,
"createdByUserId": 123
}
'import requests
url = "https://api.smartbills.io/v1/businesses/{businessId}/workflows"
payload = {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"entityType": "<string>",
"priority": 123,
"enabled": True,
"effectiveFrom": "2023-11-07T05:31:56Z",
"effectiveTo": "2023-11-07T05:31:56Z",
"tags": "<string>",
"conditions": [{}],
"actions": [
{
"id": 123,
"order": 123
}
],
"triggers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventType": "<string>",
"scheduleExpression": "<string>",
"eventPattern": "<string>",
"enabled": True,
"configuration": {}
}
],
"steps": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"order": 123,
"isRequired": True,
"timeoutMinutes": 123,
"maxRetryAttempts": 123,
"retryDelaySeconds": 123,
"dependsOnSteps": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"successConditions": [{}],
"failureConditions": [{}],
"preConditions": [{}],
"actions": [
{
"id": 123,
"order": 123
}
],
"eventExpectations": [
{
"eventType": "<string>",
"eventPattern": "<string>",
"timeoutMinutes": 123,
"isRequired": True,
"expectedPayload": {}
}
],
"onSuccess": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [{}],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": True,
"stopReason": "<string>"
},
"onFailure": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [{}],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": True,
"stopReason": "<string>"
},
"onTimeout": {
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>",
"conditionalBranches": [
{
"conditions": [{}],
"nextStepId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextStepName": "<string>"
}
],
"stopWorkflow": True,
"stopReason": "<string>"
},
"configuration": {},
"isActive": True,
"timers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"delayMinutes": 123,
"actions": [
{
"id": 123,
"order": 123
}
],
"conditions": [{}],
"isRecurring": True,
"maxRecurrences": 123,
"isActive": True
}
],
"canRunInParallel": True,
"priority": 123,
"tags": ["<string>"]
}
],
"jsonConfig": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"businessId": 123,
"createdByUserId": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
entityType: '<string>',
priority: 123,
enabled: true,
effectiveFrom: '2023-11-07T05:31:56Z',
effectiveTo: '2023-11-07T05:31:56Z',
tags: '<string>',
conditions: [{}],
actions: [{id: 123, order: 123}],
triggers: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
eventType: '<string>',
scheduleExpression: '<string>',
eventPattern: '<string>',
enabled: true,
configuration: {}
}
],
steps: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
workflowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
order: 123,
isRequired: true,
timeoutMinutes: 123,
maxRetryAttempts: 123,
retryDelaySeconds: 123,
dependsOnSteps: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
successConditions: [{}],
failureConditions: [{}],
preConditions: [{}],
actions: [{id: 123, order: 123}],
eventExpectations: [
{
eventType: '<string>',
eventPattern: '<string>',
timeoutMinutes: 123,
isRequired: true,
expectedPayload: {}
}
],
onSuccess: {
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>',
conditionalBranches: [
{
conditions: [{}],
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>'
}
],
stopWorkflow: true,
stopReason: '<string>'
},
onFailure: {
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>',
conditionalBranches: [
{
conditions: [{}],
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>'
}
],
stopWorkflow: true,
stopReason: '<string>'
},
onTimeout: {
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>',
conditionalBranches: [
{
conditions: [{}],
nextStepId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
nextStepName: '<string>'
}
],
stopWorkflow: true,
stopReason: '<string>'
},
configuration: {},
isActive: true,
timers: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
delayMinutes: 123,
actions: [{id: 123, order: 123}],
conditions: [{}],
isRecurring: true,
maxRecurrences: 123,
isActive: true
}
],
canRunInParallel: true,
priority: 123,
tags: ['<string>']
}
],
jsonConfig: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
businessId: 123,
createdByUserId: 123
})
};
fetch('https://api.smartbills.io/v1/businesses/{businessId}/workflows', 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.smartbills.io/v1/businesses/{businessId}/workflows",
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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'entityType' => '<string>',
'priority' => 123,
'enabled' => true,
'effectiveFrom' => '2023-11-07T05:31:56Z',
'effectiveTo' => '2023-11-07T05:31:56Z',
'tags' => '<string>',
'conditions' => [
[
]
],
'actions' => [
[
'id' => 123,
'order' => 123
]
],
'triggers' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'eventType' => '<string>',
'scheduleExpression' => '<string>',
'eventPattern' => '<string>',
'enabled' => true,
'configuration' => [
]
]
],
'steps' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'workflowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'order' => 123,
'isRequired' => true,
'timeoutMinutes' => 123,
'maxRetryAttempts' => 123,
'retryDelaySeconds' => 123,
'dependsOnSteps' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'successConditions' => [
[
]
],
'failureConditions' => [
[
]
],
'preConditions' => [
[
]
],
'actions' => [
[
'id' => 123,
'order' => 123
]
],
'eventExpectations' => [
[
'eventType' => '<string>',
'eventPattern' => '<string>',
'timeoutMinutes' => 123,
'isRequired' => true,
'expectedPayload' => [
]
]
],
'onSuccess' => [
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>',
'conditionalBranches' => [
[
'conditions' => [
[
]
],
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>'
]
],
'stopWorkflow' => true,
'stopReason' => '<string>'
],
'onFailure' => [
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>',
'conditionalBranches' => [
[
'conditions' => [
[
]
],
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>'
]
],
'stopWorkflow' => true,
'stopReason' => '<string>'
],
'onTimeout' => [
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>',
'conditionalBranches' => [
[
'conditions' => [
[
]
],
'nextStepId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'nextStepName' => '<string>'
]
],
'stopWorkflow' => true,
'stopReason' => '<string>'
],
'configuration' => [
],
'isActive' => true,
'timers' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'delayMinutes' => 123,
'actions' => [
[
'id' => 123,
'order' => 123
]
],
'conditions' => [
[
]
],
'isRecurring' => true,
'maxRecurrences' => 123,
'isActive' => true
]
],
'canRunInParallel' => true,
'priority' => 123,
'tags' => [
'<string>'
]
]
],
'jsonConfig' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'businessId' => 123,
'createdByUserId' => 123
]),
CURLOPT_HTTPHEADER => [
"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.smartbills.io/v1/businesses/{businessId}/workflows"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"entityType\": \"<string>\",\n \"priority\": 123,\n \"enabled\": true,\n \"effectiveFrom\": \"2023-11-07T05:31:56Z\",\n \"effectiveTo\": \"2023-11-07T05:31:56Z\",\n \"tags\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"triggers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventType\": \"<string>\",\n \"scheduleExpression\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"enabled\": true,\n \"configuration\": {}\n }\n ],\n \"steps\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"order\": 123,\n \"isRequired\": true,\n \"timeoutMinutes\": 123,\n \"maxRetryAttempts\": 123,\n \"retryDelaySeconds\": 123,\n \"dependsOnSteps\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"successConditions\": [\n {}\n ],\n \"failureConditions\": [\n {}\n ],\n \"preConditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"eventExpectations\": [\n {\n \"eventType\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"timeoutMinutes\": 123,\n \"isRequired\": true,\n \"expectedPayload\": {}\n }\n ],\n \"onSuccess\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onFailure\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onTimeout\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"configuration\": {},\n \"isActive\": true,\n \"timers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"delayMinutes\": 123,\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"conditions\": [\n {}\n ],\n \"isRecurring\": true,\n \"maxRecurrences\": 123,\n \"isActive\": true\n }\n ],\n \"canRunInParallel\": true,\n \"priority\": 123,\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"jsonConfig\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"businessId\": 123,\n \"createdByUserId\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.smartbills.io/v1/businesses/{businessId}/workflows")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"entityType\": \"<string>\",\n \"priority\": 123,\n \"enabled\": true,\n \"effectiveFrom\": \"2023-11-07T05:31:56Z\",\n \"effectiveTo\": \"2023-11-07T05:31:56Z\",\n \"tags\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"triggers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventType\": \"<string>\",\n \"scheduleExpression\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"enabled\": true,\n \"configuration\": {}\n }\n ],\n \"steps\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"order\": 123,\n \"isRequired\": true,\n \"timeoutMinutes\": 123,\n \"maxRetryAttempts\": 123,\n \"retryDelaySeconds\": 123,\n \"dependsOnSteps\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"successConditions\": [\n {}\n ],\n \"failureConditions\": [\n {}\n ],\n \"preConditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"eventExpectations\": [\n {\n \"eventType\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"timeoutMinutes\": 123,\n \"isRequired\": true,\n \"expectedPayload\": {}\n }\n ],\n \"onSuccess\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onFailure\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onTimeout\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"configuration\": {},\n \"isActive\": true,\n \"timers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"delayMinutes\": 123,\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"conditions\": [\n {}\n ],\n \"isRecurring\": true,\n \"maxRecurrences\": 123,\n \"isActive\": true\n }\n ],\n \"canRunInParallel\": true,\n \"priority\": 123,\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"jsonConfig\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"businessId\": 123,\n \"createdByUserId\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartbills.io/v1/businesses/{businessId}/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"entityType\": \"<string>\",\n \"priority\": 123,\n \"enabled\": true,\n \"effectiveFrom\": \"2023-11-07T05:31:56Z\",\n \"effectiveTo\": \"2023-11-07T05:31:56Z\",\n \"tags\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"triggers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventType\": \"<string>\",\n \"scheduleExpression\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"enabled\": true,\n \"configuration\": {}\n }\n ],\n \"steps\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"workflowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"order\": 123,\n \"isRequired\": true,\n \"timeoutMinutes\": 123,\n \"maxRetryAttempts\": 123,\n \"retryDelaySeconds\": 123,\n \"dependsOnSteps\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"successConditions\": [\n {}\n ],\n \"failureConditions\": [\n {}\n ],\n \"preConditions\": [\n {}\n ],\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"eventExpectations\": [\n {\n \"eventType\": \"<string>\",\n \"eventPattern\": \"<string>\",\n \"timeoutMinutes\": 123,\n \"isRequired\": true,\n \"expectedPayload\": {}\n }\n ],\n \"onSuccess\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onFailure\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"onTimeout\": {\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\",\n \"conditionalBranches\": [\n {\n \"conditions\": [\n {}\n ],\n \"nextStepId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"nextStepName\": \"<string>\"\n }\n ],\n \"stopWorkflow\": true,\n \"stopReason\": \"<string>\"\n },\n \"configuration\": {},\n \"isActive\": true,\n \"timers\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"delayMinutes\": 123,\n \"actions\": [\n {\n \"id\": 123,\n \"order\": 123\n }\n ],\n \"conditions\": [\n {}\n ],\n \"isRecurring\": true,\n \"maxRecurrences\": 123,\n \"isActive\": true\n }\n ],\n \"canRunInParallel\": true,\n \"priority\": 123,\n \"tags\": [\n \"<string>\"\n ]\n }\n ],\n \"jsonConfig\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"businessId\": 123,\n \"createdByUserId\": 123\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
Body
application/jsontext/jsonapplication/*+json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
200
OK
Was this page helpful?
⌘I