This page provides an overview of trigger-related APIs.
Object Overview
Triggers provide a set of match criteria such as an HTTP method and URL to which a data flow is mapped. A trigger indicates what event should cause the execution of the steps within a dataflow and its map.
Endpoint, URL, and Supported Methods
Objects are managed via the View Orchestrator server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/triggers
Supported methods include: GET
HEAD
PUT
DELETE
Structure
Objects have the following structure:
{
"GUID": "processor",
"TenantGUID": "default",
"TriggerType": "HTTP",
"Name": "My processing pipeline trigger",
"HttpMethod": "POST",
"HttpUrlPrefix": "/processor",
"CreatedUtc": "2024-07-10T05:10:14.000000Z"
}
Properties:
GUID
GUID
globally unique identifier for the objectTenantGUID
GUID
globally unique identifier for the tenantTriggerType
enum
type of trigger, currently onlyHTTP
Name
string
name of the objectHttpMethod
enum
the HTTP method that must match, i.e.GET
PUT
POST
DELETE
HttpUrlPrefix
string
the prefix by which the HTTP URL must matchCreatedUtc
datetime
timestamp from creation, in UTC time
Create
To create, call PUT /v1.0/tenants/[tenant-guid]/triggers
with the following properties using the Orchestrator server: TriggerType
Name
HttpMethod
HttpUrlPrefix
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/triggers' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"TriggerType": "HTTP",
"Name": "My second trigger",
"HttpMethod": "GET",
"HttpUrlPrefix": "/default2"
}'
import { ViewOrchestratorSdk } from "view-sdk";
const orchestrator = new ViewOrchestratorSdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const createTrigger = async () => {
try {
const response = await orchestrator.createTrigger({
TriggerType: "HTTP",
Name: "My second trigger [ASH]",
HttpMethod: "GET",
HttpUrlPrefix: "/default2",
});
console.log("Trigger created:", response);
} catch (err) {
console.log("Error creating trigger:", err);
}
};
createTrigger();
Read
To read an individual object by GUID, call GET /v1.0/tenants/[tenant-guid]/triggers/[trigger-guid]
. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound
error response.
{
"GUID": "processor",
"TenantGUID": "default",
"TriggerType": "HTTP",
"Name": "My processing pipeline trigger",
"HttpMethod": "POST",
"HttpUrlPrefix": "/processor",
"CreatedUtc": "2024-07-10T05:10:14.000000Z"
}
import { ViewOrchestratorSdk } from "view-sdk";
const orchestrator = new ViewOrchestratorSdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
)
const readTrigger = async () => {
try {
const response = await orchestrator.retrieveTrigger(
"7a58f1e8-172c-43cb-a433-0a7f8eed4bbf"
);
console.log("Trigger:", response);
} catch (err) {
console.log("Error reading trigger:", err);
}
};
readTrigger();
Note: the HEAD
method can be used as an alternative to get to simply check the existence of the object. HEAD
requests return either a 200/OK
in the event the object exists, or a 404/Not Found
if not. No response body is returned with a HEAD
request.
Read all
To read all objects, call GET /v1.0/tenants/[tenant-guid]/triggers
, which will return an array of objects. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound
error response.
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/triggers' \
--header 'Authorization: ••••••'
import { ViewOrchestratorSdk } from "view-sdk";
const orchestrator = new ViewOrchestratorSdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
)
const readTriggers = async () => {
try {
const response = await orchestrator.retrieveTriggers();
console.log("Triggers:", response);
} catch (err) {
console.log("Error reading triggers:", err);
}
};
readTriggers();
Update
To update an object by GUID, call PUT /v1.0/tenants/[tenant-guid]/triggers/[trigger-guid]
with a fully populated object in the request body. The updated object will be returned to you.
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/triggers/00000000-0000-0000-0000-000000000000' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"TriggerType": "HTTP",
"Name": "My updated trigger",
"HttpMethod": "GET",
"HttpUrlPrefix": "/default2"
}'
import { ViewOrchestratorSdk } from "view-sdk";
const orchestrator = new ViewOrchestratorSdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
)
const updateTrigger = async () => {
try {
const response = await orchestrator.updateTrigger({
GUID: "7a58f1e8-172c-43cb-a433-0a7f8eed4bbf",
TenantGUID: "00000000-0000-0000-0000-000000000000",
Name: "My second trigger [ASH UPDATED]",
TriggerType: "HTTP",
HttpMethod: "GET",
HttpUrlPrefix: "/default2",
Notes: undefined,
CreatedUtc: "2025-04-21T11:30:52.176516Z",
});
console.log("Trigger updated:", response);
} catch (err) {
console.log("Error updating trigger:", err);
}
};
updateTrigger();
Note: certain fields cannot be modified and will be preserved across updates.
Request body:
{
"GUID": "processor",
"TenantGUID": "default",
"TriggerType": "HTTP",
"Name": "My updated processing pipeline trigger",
"HttpMethod": "POST",
"HttpUrlPrefix": "/processor",
"CreatedUtc": "2024-07-10T05:10:14.000000Z"
}
Response body:
{
"GUID": "processor",
"TenantGUID": "default",
"TriggerType": "HTTP",
"Name": "My updated processing pipeline trigger",
"HttpMethod": "POST",
"HttpUrlPrefix": "/processor",
"CreatedUtc": "2024-07-10T05:10:14.000000Z"
}
Delete
To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/triggers/[trigger-guid]
.
curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/triggers/00000000-0000-0000-0000-000000000000' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data ''
import { ViewOrchestratorSdk } from "view-sdk";
const orchestrator = new ViewOrchestratorSdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
)
const deleteTrigger = async () => {
try {
const response = await orchestrator.deleteTrigger(
"7a58f1e8-172c-43cb-a433-0a7f8eed4bbf"
);
console.log("Trigger deleted:", response);
} catch (err) {
console.log("Error deleting trigger:", err);
}
};
deleteTrigger();
Check existence
To check existence of an object by GUID, call HEAD /v1.0/tenants/[tenant-guid]/triggers/[trigger-guid]
.
curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/triggers/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewOrchestratorSdk } from "view-sdk";
const orchestrator = new ViewOrchestratorSdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
)
const existTrigger = async () => {
try {
const response = await orchestrator.retrieveTrigger(
"7a58f1e8-172c-43cb-a433-0a7f8eed4bbf"
);
console.log("Trigger exists:", response);
} catch (err) {
console.log("Error checking trigger:", err);
}
};
existTrigger();