campaign.template.list

The campaign.template.list command is used to find and return a list of campaign templates.

TR50 Request

{  
   "1":{  
      "command":"campaign.template.list",
      "params":{  
         "sort":"-group"
      }
   }
}

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. The maximum limit you can set is 2000. Defaults to 2000.
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.template.list in the following categories:
  • name (default)- The name of the template
  • group - The group to which the template belongs to.

TR50 Response

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

{
  "1": {
    "success": true,
    "params": {
      "result": [
        {
          "id": "53728d6b31004662fe000052",
          "name": "Get SMS",
          "desc": "Gets an SMS",
	   "group": "Group1",
          "started": false,
          "eventType": "twilio.sms.receive",
          "successCount": 4,
          "lastSuccess": "2014-05-14T15:30:14.551Z",
          "failureCount": 0,
          "lastFailure": "0001-01-01T00:00:00Z",
          "createdBy": "jhughes@ilstechnology.com",
          "createdOn": "2014-05-13T21:23:55.561Z",
          "updatedBy": "admin@devicewise.com",
          "updatedOn": "2014-06-06T19:27:04.136Z"
        },
        {
          "id": "5391cf323100465ec1000087",
          "name": "Turn on Heater when Cold",
	   "group": "Group2",
          "started": false,
          "eventType": "property.change",
          "successCount": 4,
          "lastSuccess": "2014-06-11T09:00:45.038Z",
          "failureCount": 0,
          "lastFailure": "0001-01-01T00:00:00Z",
          "createdBy": "jwert@ilstechnology.com",
          "createdOn": "2014-06-06T14:24:50.984Z",
          "updatedBy": "jwert-fa@ilstechnology.com",
          "updatedOn": "2014-06-11T12:49:46.064Z"
        }
      ]
    }
  }
}

Response Parameters

Name
Type
Description
result Array An array consisting of result objects.

Result Object

Name Type Description
id String The unique identifier of the campaign.
name String The name of the campaign.
desc String The description of the campaign.
started Boolean Whether the campaign has been started.
group String The group to which the Campaign template belongs to.
eventType String The campaign event type.
successCount Integer Number of times the campaign has been successfully executed.
lastSuccess String Timestamp of the last successful execution associated with this campaign.
failureCount Integer Number of times the campaign has failed during execution.
lastFailure String Timestamp of the last failed execution associated with this campaign.
createdBy String  The creator of this campaign.
createdOn String The timestamp of campaign creation.
updatedBy String The updater of this campaign.
updatedOn String The update timestamp of this campaign.