trigger.find
The trigger.find command is used to find and return a trigger.
TR50 Request
{
"cmd": {
"command": "trigger.find",
"params": {
"id": "53728d6b31004662fe000052"
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
id |
String |
Yes |
The unique identifier to find. |
TR50 Response
If the command is sent successfully a success message and the result is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true,
"params": {
"id": "58e6a81ef0cd7e2ab800016a",
"orgId": "560ef49c681fdc7d1f015605",
"orgKey": "DEMO",
"name": "Get SMS",
"started": false,
"eventType": "twilio.sms.receive",
"event": {
"phoneNumber": "+15615294890"
},
"reportMode": "On",
"reportUntil": "2018-01-01T00:00:00Z",
"actions": {
"0": {
"type": "twilio.sms.send",
"params": {
"body": "I got an SMS",
"to": "9542493829"
},
"canvas": {
"failure": "failure-end0",
"left": "51",
"success": "success-end0",
"top": "182"
},
"routes": {
"failure": "$endFailure",
"success": "$endSuccess"
}
}
},
"firstAction": "0",
"canvas": {
"event": {
"left": "50",
"top": "50"
},
"failure-end": {
"0": {
"left": "41",
"top": "275"
}
},
"success-end": {
"0": {
"left": "163",
"top": "275"
}
}
},
"successCount": 0,
"failureCount": 0,
"dailySuccessCount": 0,
"dailyFailureCount": 0,
"lastSuccess": "0001-01-01T00:00:00Z",
"lastFailure": "0001-01-01T00:00:00Z",
"createdBy": "user@example.com",
"createdOn": "2017-04-06T16:42:06.418-04:00",
"updatedBy": "user@example.com",
"updatedOn": "2017-04-06T16:42:06.418-04:00"
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
id |
String |
The unique identifier of the trigger. |
orgId |
String |
The ID of the org. |
orgKey |
String |
The key of the org. |
name |
String |
The name of the trigger. |
desc |
String |
The description of the trigger. |
started |
Boolean |
Whether the trigger has been started. |
eventType |
String |
The trigger event type. |
event |
String |
The event object. Parameters depend on the eventType. For more details, see trigger.event.list. |
reportMode |
String |
|
reportUntil |
String |
The reportUntil attribute applies only when On is specified for reportMode and provides the date and time when the report mode will switch to On failure (the default). |
actions |
Array |
Array of action objects. Parameters depend on each action's type. For more details, see trigger.action.list. |
firstAction |
String |
Identifier of the first action that takes place. |
canvas |
Array |
Canvas information of where the event, failure-end, and success-end elements are placed. |
successCount |
Integer |
Number of times the trigger has been successfully executed. |
dailySuccessCount |
Integer |
Number of times the trigger has been successfully executed today. |
lastSuccess |
String |
Timestamp of the last successful execution associated with this trigger. |
failureCount |
Integer |
Number of times the trigger has failed during execution. |
dailyFailureCount |
Integer |
Number of times the trigger has failed during execution today. |
lastFailure |
String |
Timestamp of the last failed execution associated with this trigger. |
dailySuccessCount |
Integer |
Number of successes for the current day. |
dailyFailureCount |
Integer |
Number of failures for the current day. |
execTime |
Integer |
Time trigger took to last execute. |
activeWindow |
Array |
Array of day and hour values that indicate when the trigger can run. The key of the array is in the format DH:day:hour. The range of day is zero through six and represents the day of the week (for example, 0 for Sunday, 1 for Monday). The value of hour is specified in 24 hour format (for example, 0 for midnight, 6 for 6:00 a.m., 12 for noon, 18 for 6:00 p.m.). For example, the value DH:3:14 represents Wednesday at 2:00 p.m. The value portion of the key-value pair is typically set to the Boolean value true. |
activeWindowTz |
String |
The timezone that the time portion of the attribute activeWindow defines. |
createdBy |
String |
The creator of this trigger. |
createdOn |
String |
The creation timestamp of this trigger. |
updatedBy |
String |
The updater of this trigger. |
updatedOn |
String |
The update timestamp of this trigger. |
Action Object
Name |
Type |
Description |
---|---|---|
type |
String |
Action type. |
params |
Array |
A set of named parameters for the action. This varies by action. |
canvas |
Array |
Canvas information where the action is placed. |
routes |
Array |
Where the success and failure points go. |
Action Canvas Object
Name |
Type |
Description |
---|---|---|
success |
String |
When successful, this defines the next node to execute. |
failure |
String |
When there is a failure, this defines the next node to execute. |
left |
String |
A numeric string indicating the left-offset where the action should appear on the canvas. |
top |
String |
A numeric string indicating the top-offset where the action should appear on the canvas. |
Action Routes Object
Name |
Type |
Description |
---|---|---|
success |
String |
When successful, this defines the next node to execute. |
failure |
String |
When there is a failure, this defines the next node to execute. |