campaign.find

The campaign.find command is used to find and return a campaign.

TR50 Request


                            {
  "cmd": {
    "command": "campaign.find",
    "params": {
      "id": "537a3fa6d15a702de0000007"
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

id

String

Yes

The unique identifier of the campaign to find.

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": "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
                    }
                }
            },
            "firstAction": "1",
            "maxInProgress": 100,
            "status": "new",
            "ts": "2018-05-25T13:48:25.764Z",
            "startedOn": "0001-01-01T00:00:00Z",
            "completedOn": "0001-01-01T00:00:00Z",
            "summary": {
                "ready": 230,
                "inProgress": 0,
                "success": 0,
                "failure": 0
            },
              "emailUpdates": {
                "sendTo": "admin@telit.com",
                "enableDaily": true
                "enableEndNotice": true
            },
            "createdBy": "admin@telit.com",
            "createdOn": "2018-05-25T13:48:25.764Z",
            "updatedBy": "admin@telit.com",
            "updatedOn": "2018-05-25T13:58:04.954Z"
        }
    }
}
      

Response Parameters

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.thing: runs on a set of things.

actions

Array

Array of action objects. For more information, see, the Action Objects 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

new: The campaign has been never scheduled or started.

scheduled: The campaign is scheduled.

running: The campaign has started.

completed: The campaign is completed.

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

ready: The number of tasked things that remain queued for execution.

inProgress: The number of tasked Things that are in progress.

success: The number of tasked things that have completed successfully.

failed: The number of tasked things that have failed during execution.

emailUpdates

String

SendTo: Email addresses to notify.

enableDaily: Enables daily campaign updates.

enableEndNotice: Enables end of campaign notification when a campaign completes.

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 update 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.