Supported Formats

json

GET /api/v2/campaigns
List of visible campaigns

Returns the list of visible campaigns with some general information.

Supported Formats

json

Errors

Code Description
400 Various errors: the specific error is provided in the message field of the response
401 Token is invalid
401 You must authenticate to perform this request.
404 The requested resource was not found.

Examples

GET '/api/v2/campaigns':
 [
   {
     "id":271,"name":"Campaign test 2",
     "created_at":"April 28, 2014 15:37",
     "status":"Pending",
     "targeted_asset_count":9,
     "asset_group_count":1,
     "warnings":"2 incompatible assets"
   },
   {
     "id":270,
     "name":"Campaign test 1",
     "created_at":"April 25, 2014 13:28",
     "status":"Sent",
     "targeted_asset_count":1,
     "asset_group_count":1
   }
 ] 

Params

Param name Description
_token
required

Validations:

  • Must be a String

archived
optional

Include archived campaigns

Validations:

  • Must be one of: true, false.


GET /api/v2/campaigns/:id
Get a specific campaign

Returns detailed information about a campaign.

Supported Formats

json

Errors

Code Description
400 Various errors: the specific error is provided in the message field of the response
401 Token is invalid
401 You must authenticate to perform this request.
404 The requested resource was not found.

Examples

GET '/api/v2/campaigns/271':
 {
   "id":271,
   "name":"Ze aPi TEst3",
   "created_at":"April 28, 2014 15:37",
   "status":"Pending",
   "asset_configuration_list":[390,397],
   "targeted_asset_count":1,
   "targeted_assets":[],
   "assets_status": [ { "imei": "XXX", "status": "" }]
   "asset_group_count":1,
   "asset_group_ids":[52],
   "warnings":["The following assets are not compatible with the campaign's configurations : ",["359858024444692"]]
 } 

Params

Param name Description
_token
required

Validations:

  • Must be a String


POST /api/v2/campaigns
Create a campaign

Create an asset update campaign by providing a name, a list of configurations, a list of assets, and / or a list of asset groups. There can be one or more configurations, and there must be at least when valid asset (either alone or in an asset group).

Supported Formats

json

Errors

Code Description
400 Various errors: the specific error is provided in the message field of the response
401 Token is invalid
401 You must authenticate to perform this request.
404 The requested resource was not found.

Examples

Create a campaign to update the configuation :
POST '/api/v2/campaigns' -d {
  "name" : "test campaign",
  "config_ids" : [414, 413],
  "asset_group_ids" : [],
  "targeted_asset_imeis" : ["357322044471026", "359858033385302"],
  "ignore_last_campaign" : false,
  "force_update" : false,    
  "reboot_mode": -1,
  "on_boot": false
} :
{
  "id":272,
  "name":"test campaign",
  "created_at":"April 28, 2014 15:37",
  "status":"Pending",
  "asset_configuration_list":[414, 413],
  "targeted_asset_count":2,
  "targeted_assets":["357322044471026", "359858033385302"],
  "asset_group_count":0,
  "asset_group_ids":[],
  "reboot_mode": -1,
  "on_boot": false
  "warnings":["The following assets are not compatible with the campaign's configurations : ",["357322044471026"]]
}
Create a campaign to update the software :
POST '/api/v2/campaigns' -d {
  "name" : "test campaign ota",
  "asset_software_update_id" : 28,
  "asset_group_ids" : [],
  "update_type" : 1,
  "targeted_asset_imeis" : ["357322044471026", "359858033385302"]
} :
{
  "id":242,
  "name":"test campaign ota",
  "created_at":"June 28, 2014 15:37",
  "status":"Pending",
  "asset_software_update_id":28,
  "targeted_asset_count":2,
  "targeted_assets":["357322044471026", "359858033385302"],
  "asset_group_count":0,
  "asset_group_ids":[],
  "warnings":[]
}

Params

Param name Description
_token
required

Validations:

  • Must be a String

name
required

Name of the campaign

Validations:

  • Must be a String

config_ids
required

List of the ids of the configurations to be applied

Validations:

  • Must be an array of any type

asset_software_update_id
required

Version Id targeted for the update

Validations:

  • Must be a Integer

update_type
optional

[default : 0] 0 - configuration update / 1 - software update

Validations:

  • Must be a Integer

targeted_asset_imeis
required

List of the imeis of the assets to which the campaign will be applied

Validations:

  • Must be an array of any type

asset_group_ids
required

List of the ids of the asset groups to which the campaign will be applied

Validations:

  • Must be an array of any type

ignore_last_campaign
optional

Ignore all campaigns in providingress for each asset (switch the status to ‘fail’ and never apply the configuration associated with the previous campaign), use with caution

Validations:

  • Must be one of: true, false.

force_update
optional

if true, Munic Manager will not wait until the devices reconnect to the cloud to send the campaign (same function as the update button on the asset page)

Validations:

  • Must be one of: true, false.

reboot_mode
optional

[default : -1] (-1) - Inherited from device version / 0 - no reboot / 1 - immediate reboot / 2 - override next idle

Validations:

  • Must be one of: -1, 0, 1, 2.

on_boot
optional

[default : null] if null, value will be inherited from device version, if true Save the configuration on the flash to be applied on the next boot

Validations:

  • Must be one of: true, false.


PUT /api/v2/campaigns/:id/edit
Edit a campaign

Modify an assets name, provide a new list of assets or change configurations. You can not modify a campaign that has already been sent.

Supported Formats

json

Errors

Code Description
400 Various errors: the specific error is provided in the message field of the response
401 Token is invalid
401 You must authenticate to perform this request.
404 The requested resource was not found.
411 If this error occurs, either provide the `Content-type: 0` header or provide an empty data field (`{}` for example).

Examples

PUT '/api/v2/campaigns/272' -d {
   "name" : "test campaign renamed"
 } :
 {
   "id":272,
   "name":"test campaign renamed",
   "created_at":"April 28, 2014 15:37",
   "status":"Pending",
   "asset_configuration_list":[414, 413],
   "targeted_asset_count":2,
   "targeted_assets":["357322044471026", "359858033385302"],
   "asset_group_count":0,
   "asset_group_ids":[],
   "warnings":["The following assets are not compatible with the campaign's configurations : ",["357322044471026"]]
 } 

Params

Param name Description
_token
required

Validations:

  • Must be a String

name
optional

New name of the campaign

Validations:

  • Must be a String

config_ids
optional

New list of configurations

Validations:

  • Must be an array of any type

targeted_asset_imeis
optional

New list of imeis

Validations:

  • Must be an array of any type

asset_group_ids
optional

New list of asset groups

Validations:

  • Must be an array of any type

ignore_last_campaign
optional

Ignore all campaigns in progress for each asset (switch the status to ‘fail’ and never apply the configuration associated with the previous campaign), use with caution

Validations:

  • Must be one of: true, false.

force_update
optional

if true, Munic Manager will not wait until the devices reconnect to the cloud to send the campaign (same function as the update button on the asset page)

Validations:

  • Must be one of: true, false.


PUT /api/v2/campaigns/:id/launch
Launch a campaign

Launch a campaign targeting all assets both compatible and not already being updated in another campaign.

Supported Formats

json

Errors

Code Description
400 Various errors: the specific error is provided in the message field of the response
401 Token is invalid
401 You must authenticate to perform this request.
404 The requested resource was not found.
411 If this error occurs, either provide the `Content-type: 0` header or provide an empty data field (`{}` for example).

Examples

PUT '/api/v2/campaigns/272/launch' -d {} :
 {
   "id":272,
   "name":"test campaign renamed",
   "created_at":"April 28, 2014 15:37",
   "status":"Sent",
   "asset_configuration_list":[414, 413],
   "targeted_asset_count":2,
   "targeted_assets":["357322044471026", "359858033385302"],
   "asset_group_count":0,
   "asset_group_ids":[],
   "warnings":["The following assets are not compatible with the campaign's configurations : ",["357322044471026"]]
 } 

Params

Param name Description
_token
required

Validations:

  • Must be a String