campaign.member.add

The campaign.member.add command is used to add things to a campaign.

TR50 Request


                            {
  "cmd": {
    "command": "campaign.member.add",
    "params": {
      "campaignId": "537a3fa6d15a702de0000007",
      "thingKey": ["homehvac", "homeweather"]
    }
  }
}
      

Request Parameters

Name

Type

Required

Description

campaignId

String

Yes

The unique identifier of the campaign.

thingId

Array

 

An array of thing IDs.

thingAll

Boolean

 

If true, adds all available things to the campaign.

thingKey

Array

 

One or more thing keys to add to the campaign.

thingTag

Array

 

If specified, will add the things that has all of these tags. This cannot be used in conjunction with the thingkeys param.

thingQuery

String

 

If specified, this will add things that conform to the search criteria for the campaign. For more information on formats, see Searching for Things.

connectionId

Array

 

An array of connection IDs.

connectionIdentifier

Array

 

An array of connection identifiers to match. The IDs can include but are not limited to: ESN, ICCID, and MSISDN. The values specified can be a mix of any connection identifiers. For example, the array can contain the values for a connection's ESN, another connection's ICCID, and the MSISDN for a third.

connectionTag

Array

 

If specified, will add connections that possess all the tags. It cannot be used in conjunction with other params.

connectionQuery

String

 

If specified, will add connections to the campaign that conform to the search criteria.

connectionAll

Boolean

 

If true, adds all available Connections to the campaign.

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": {
      "good": 2,
      "bad": 0
    }
  }
}
      

Response Parameters

Name

Type

Description

good

Integer

The number of requested things that were successfully added to the campaign for the first time.

bad

Integer

The number of requested things that failed to be added to the campaign for any reason.