Create a Trigger object
Audience:
•
Version: 10.3.5
Some tooltip text!
• 2 minutes to read
• 2 minutes to read
Triggers serve as automated starting points for flows, allowing for multiple entry points and additional filters to target specific contacts. Utilize the REST CreateDefaultWorkflowTrigger endpoint to retrieve a pre-populated default WorkflowTrigger
, ideal for initiating new triggers.
Note
A new trigger can be saved alongside a new flow by including it in the flow object. Alternatively, a trigger can be saved to an existing flow using the SaveWorkflowTrigger Agent.
Request
POST https://{{env}}.superoffice.com/{{tenant}}/v1/Agents/Workflow/CreateDefaultWorkflowTrigger HTTP/1.1
Authorization: Bearer {{access_token}}
Accept: application/json
Response
{
"WorkflowTriggerId": 0,
"WorkflowId": 0,
"TriggerType": "None",
"RestrictionGroups": [],
"TableRight": null,
"FieldProperties": {}
}
Key properties
Property | Description |
---|---|
WorkflowTriggerId | Unique identifier assigned by the system upon saving the trigger. Should not be set manually. |
WorkflowId | Unique identifier for the flow. Automatically set to the flow's ID if the trigger is part of the flow. |
TriggerType | Name (not the enumValue) of the trigger type being created. Refer to the type of trigger documentation for details. |
RestrictionGroups | Specifies the conditions under which the trigger should execute. Similar to ArchiveRestrictionGroup for Find. |
Example of edited Trigger object
{
"WorkflowTriggerId": 0,
"WorkflowId": 1,
"TriggerType": "CreatedRequest",
"RestrictionGroups": [
{
"Name": "Trigger from API",
"Description": "This trigger is created through the API",
"Rank": 0,
"Restrictions": [
{
"Name": "request/slevel",
"Operator": "oneOf",
"Values": [
"[I:1]"
]
}
]
}
]
}
Response:
{
"WorkflowTriggerId": 5,
"WorkflowId": 1,
"TriggerType": "CreatedRequest",
"RestrictionGroups": [
{
"Name": "Trigger from API",
"Description": "This trigger is created through the API",
"Rank": 0,
"Restrictions": [
{
"Name": "request/slevel",
"Operator": "oneOf",
"Values": [
"[I:1]"
],
"DisplayValues": [
"[SR_SLEVEL_INTERNAL]"
],
"ColumnInfo": {
"DisplayName": "[SR_TICKETARCHIVE_SLEVEL]",
"DisplayTooltip": "[SR_TICKETARCHIVE_SLEVEL]",
"DisplayType": "string",
"CanOrderBy": true,
"Name": "request/slevel",
"CanRestrictBy": true,
"RestrictionType": "listAny",
"RestrictionListName": "TicketSLevel",
"IsVisible": true,
"ExtraInfo": "",
"Width": "10%",
"IconHint": "Ticket",
"HeadingIconHint": ""
},
"IsActive": true,
"SubRestrictions": null,
"InterParenthesis": 0,
"InterOperator": "And",
"UniqueHash": 422435087
}
]
}
],
"TableRight": null,
"FieldProperties": {}
}