campaign.list
The campaign.list command is used to find and return a list of campaigns.
TR50 Request
{
"cmd": {
"command": "campaign.list"
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
offset |
Integer |
|
The starting list offset, used for pagination. Defaults to 0 if not specified. |
limit |
Integer |
|
Limit the number of results returned. Defaults to the configured maximum limit. |
TR50 Response
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true,
"params": {
"count": 2,
"result": [
{
"id": "5b081429fe2a13515877b452",
"orgId": "594ab4fefe2a1316f2d81fb0",
"name": "FOTA101",
"eventType": "campaign.thing",
"actions": {
"1": {
"type": "thing.firmware.target_version_set",
"params": {
"targetVersion": "30.00.006",
"thingKey": "$(event.thing.key)",
"waitForCompletion": "true"
},
"canvas": {
"left": "125",
"success": "success-end0",
"top": "175"
},
"routes": {
"failure": "$endFailure",
"success": "$endSuccess"
}
}
},
"firstAction": "1",
"canvas": {
"event": {
"left": "50",
"top": "50"
},
"success-end": [
{
"left": "215.34584365218976",
"top": "324.5964864854477"
}
]
},
"reportMode": "failure",
"maxInProgress": 100,
"status": "new",
"ts": "2018-05-25T13:48:25.764Z",
"summary": {
"ready": 0,
"inProgress": 0,
"success": 0,
"failure": 0
},
"emailUpdates": {
"sendTo": "admin@telit.com, i@i.com, dfksjfdkjksdfj",
"enableEndNotice": true
},
"createdBy": "admin@telit.com",
"createdOn": "2018-05-25T13:48:25.764Z",
"updatedBy": "admin@telit.com",
"updatedOn": "2018-05-25T14:19:58.456Z"
},
{
"id": "5aa964471c5bd71ec64c43f4",
"orgId": "59bc54fefe2a1316f2c81fb0",
"name": "sup_deploy_1_1_calamp_battman_cdm5030_serial",
"eventType": "campaign.thing",
"actions": {
"0": {
"type": "gateway.sup.update",
"params": {
"name": "STAGING_DEPLOY_6M_FILE",
"thingKey": "$(event.thing.key)",
"timeout": 1200
},
"routes": {
"success": "$endSuccess"
}
}
},
"firstAction": "0",
"status": "new",
"ts": "2018-03-14T18:04:55.468Z",
"startedOn": "0001-01-01T00:00:00Z",
"completedOn": "0001-01-01T00:00:00Z",
"summary": {
"ready": 0,
"inProgress": 1,
"success": 2,
"failure": 2
},
"createdBy": "admin@telit.com",
"createdOn": "2018-03-14T18:04:55.468Z",
"updatedBy": "admin@telit.com",
"updatedOn": "2018-03-14T18:04:55.468Z"
}
]
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
count |
Integer |
The total number of campaigns. |
result |
Array |
An array consisting of result objects. |
Result Object
Name |
Type |
Description |
---|---|---|
id |
String |
The unique identifier of the campaign. |
OrgId |
String |
The ID of the Org. |
name |
String |
The name of the campaign. |
desc |
String |
The description of the trigger. |
eventType |
String |
Campaign.connection runs on a set of connections. Campaign.thingruns on a set of things. |
actions |
Array |
Array of action objects. For more information, see Action Object table. Parameters depend on each action's type. |
task |
String |
The task type of the campaign. |
firstAction |
String |
Identifier of the first action that takes place. |
canvas |
Array |
The canvas contains positioning information event and the success/failure ends. |
maxInProgress |
Integer |
The maximum number of campaign members that execute at a time. |
status |
String |
|
ts |
String |
The timestamp of execution of the campaign |
startedOn |
Timestamp |
Set once the campaign begins running. |
completedOn |
Timestamp |
Set once the campaign completes. |
Summary |
Integer |
|
createdBy |
String |
The creator of the campaign. |
createdOn |
String |
The creation timestamp of the campaign. |
updatedBy |
String |
The updater of the campaign. |
updatedOn |
String |
The timestamp of the campaign. |
Action Object
Name |
Type |
Description |
---|---|---|
type |
String |
Action type. |
params |
Array |
A set of named parameters for the action. This will vary by action. |
canvas |
Array |
Canvas information where the action is placed. |
routes |
Array |
Where the success and failure points go. |