campaign.create
The campaign.create command is used to create a new campaign.
TR50 Request
{
"cmd": {
"command": "campaign.create",
"params": {
"actions": {
"1": {
"params": {
"targetVersion": "30.00.006",
"thingKey": "$(event.thing.key)",
"waitForCompletion": true
},
"type": "thing.firmware.target_version_set"
}
},
"eventType": "campaign.thing",
"firstAction": "1",
"maxInProgress": 100,
"name": "FOTA101"
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
name |
String |
Yes |
The name of the campaign. |
desc |
String |
|
The description of the campaign. |
eventType |
String |
Yes |
Select one of the following: Campaign.connection: to run the campaign on a set of connections. Campaign.thing: to run the Campaign on a set of things. |
reportMode |
String |
|
The campaign reportMode controls when a campaign report is generated and reported.
|
actions |
Object |
Yes |
Object containing action objects indexed by non-zero integers cast as strings. Parameters depend on each action's type. Refer to the trigger.action.list call. The Actions Parameter table contains more information on each string or object in the action. Each trigger requires at least one action. |
firstAction |
Sting |
Yes |
The numeric string representing the first action to execute after the event. |
canvas |
Object |
|
The canvas request object contains positioning information for the event and the success/failure ends. Default values are created if this information is missing and the campaign is loaded in the campaign GUI. |
maxInProgress |
Integer |
|
The maximum number of campaign members that will be executed parallelly at a given point in time. |
emailUpdates |
String |
|
SendTo: Email addresses to notify. enableDaily: Enables daily campaign updates enableEndNotice: Enables end of campaign notification when a campaign completes. |
Action Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
canvas |
Object |
|
JSON object consisting of top and left values. Positions the node on the drawing canvas. Units are in pixels. Values are relative to the last position of the node or the top left of the drawing canvas if the node has never been moved. With zooming and manual positioning, values can even become negative. Also, since there can be multiple success and failure ends, these are specified in the canvas object. |
type |
String |
Yes |
Action type |
params |
Object |
|
Parameters specific to each action object. |
routes |
Object |
|
Positioning information for the action object. |
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": {
"id": "537a3fa6d15a702de0000008"
}
}
}
Response Parameters
Name |
Type |
Description |
---|---|---|
id |
String |
The unique identifier of the new campaign. |