campaign.member.list

The campaign.member.list command is used to find and return a list of campaign members.

TR50 Request
{
  "cmd": {
    "command": "campaign.member.list",
    "params": {
      "campaignId": "53a00cb831004657ad0bf666",
      "sort":"+ts"
    }
  }
}

Request Parameters

Name Type Required Description
campaignId String  Yes The unique identifier of the campaign.
sort Array sort is an optional parameter that defines the sort order of the result set. It allows to arrange the list in either ascending(+) or descending(-) order. It is possible to sort campaign.member.list in the following categories:
  • status - The status of the Campaign
  • ts - Time stamp
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 2000.
failedOnly Boolean Limit the result to only failed things

If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.

The number of records returned is limited to 5000 by the deviceWISE Cloud. If your query returns more results than the limit of the deviceWISE Cloud, you should shorten your time window or lower the number of records you are requesting.

TR50 Response
{
  "cmd":  {
        "success": true,
        "params": {
            "count": 2,
            "result": [
               {
                    "id": "5aa8b2b1fe2a13158c5c4b70",
                    "params": {
                        "key": "x64_engr_14_125",
                        "name": "auto:x64_engr_14_125"
                    },
                    "status": "success",
                    "ts": "2018-03-14T05:29:14.777Z",
                    "startedOn": "2018-03-14T20:31:22.38Z",
                    "completedOn": "2018-03-14T20:31:22.392Z",
                    "createdBy": "admin@devicewise.com",
                    "createdOn": "2018-03-14T20:31:01.384Z"
                },
                {
                    "id": "5aa98685fe2a137798d4dc67",
                    "params": {
                        "key": "x64_engr_14_126",
                        "name": "auto:x64_engr_14_126"
                    },
                    "status": "failure",
                    "ts": "2018-03-14T20:31:22.392Z",
                    "startedOn": "2018-03-14T20:31:22.38Z",
                    "completedOn": "2018-03-14T20:31:22.392Z",
                    "errorMessage": "SUP 'STAGING_DEPLOY_12M_FILE.sup.sup' not found.",
                    "errorCode": -90008,
                    "createdBy": "admin@devicewise.com",
                    "createdOn": "2018-03-14T20:31:01.384Z"
                }
            ]
        }
    }
}

Response Parameters

Name
Type
Description
count Integer The total number of matching things.
result Array An array consisting of result objects. For the list of objects in the result, see Result Object

Result Object

Name Type Description
id String The unique identifier of a member.
key String The member thing's/connection's key.
name String The member thing's/connection's name
status String The current state of the campaign member's execution
ready: 
The thing/connection is ready for the campaign to run.
inProgress: The campaign is in progress.
success: The campaign successfully completed the execution.
failure: The number of tasked Things that have failed during execution.
ts String Timestamp associated with campaign member's execution.
startedOn Timestamp The start time of the campaign.
completedOn Timestamp The end time of the campaign.
errorCode Integer If execution failed, the error message that was received during execution of the campaign task on the member.
errorMessage String If execution failed, the error message that was received during execution.
createdBy String The creator of the campaign.
createdOn String The creation timestamp of the campaign.
history Array An array of History Objects.

History Object

Name Type Description
status String The status of the campaign member's execution.
ts String Timestamp associated with the logged record.
message String The message associated with the history record (the result of the trigger.log action).