Jobs

Contents

Step 1: Login.. 1

Step 2: File Upload.. 1

1.1        Create the File Metadata. 1

1.2        Upload the File contents. 1

Step 3: File Search.. 1

Step 4: Job Creation.. 1

Appendix A:  DeviceTypes & FileTypes. 1

Appendix B:  SmartSearch. 1

1.1        SmartSearch Example Formats. 1

1.2        SmartSearch Searchable Properties. 1

Appendix C: Permissions. 1

 

 

Step 1: Login

Many of the requests outlined in this document require `Full Authentication` which is denoted by a cookie attached to the requests. To initially get the authentication cookie, use the request below with the `Content-Type: application/x-www-form-urlencoded` header.

POST:  https://connect.calamp.com/connect/services/login

Headers:

          Content-Type: application/x-www-form-urlencoded

 

EXAMPLE BODY:
username: Your CTC username
password: Your CTC password
useAuthToken: true

Step 2: File Upload

1.1        Create the File Metadata

The first task in uploading a file is to declare what type of file is going to be uploaded.  Please update the items highlighted in yellow with information relevant for the file being uploaded.

The deviceTypeId, fileTypeId, platformId, deviceTypeName, fileTypeName, and platformName can be retrieved with the API described in Appendix A or from the table in Appendix A.

The “fields:” {} section will need to populated with the required parameters as specified in the “inputFields”: {} sections of the API described in Appendix A.

 

POST:  https://connect.calamp.com/device-services/files

Headers:

          calamp-services-app: {your_api_key}

          Content-Type: application/json

 

EXAMPLE BODY for PEG2 Script: 
{
"name": "Your filename goes here",
"description": "Your description goes here",
"accountId": 1110,
"inheritableAccounts": null,
"inheritable": true,
"releaseNotesUrl": "",
"releaseNoteAttached": false,
"metadata": {
    "deviceTypeId":"0",
    "fileTypeId":"22",
    "platformId":"373",
    "platformName":"LMU PEG2",
    "fileTypeName": "PEG2",
    "deviceTypeName": "LMU",
    "fields":{
            “version”: “1.123
     }
}
}

 

EXAMPLE BODY for LMU Config (PEG script): 
{
    "name": "Your filename goes here ",
    "description": " Your description goes here",
    "accountId": 1110,
    "inheritable": true,
    "inheritableAccounts": null,
    "releaseNotesUrl": "",
    "releaseNoteAttached": false,
    "metadata": {
        "deviceTypeId": "0",
        "deviceTypeName": "LMU",
        "fileTypeId": "1",
        "fileTypeName": "Config",
        "platformId": "366",
        "platformName": "LMU Config",
        "fields": {
            "version": "1.123"
        }
    }
}

 

 

EXAMPLE BODY for Hosted App v5: 
{
"name": "Your filename goes here",
"description": "Your description goes here",
"accountId": 1110,
"inheritableAccounts": null,
"inheritable": true,
"releaseNotesUrl": "",
"releaseNoteAttached": false,
"metadata": {
    "deviceTypeId":"3",
    "fileTypeId":"21",
    "platformId":"391",
    "platformName":"Hosted App HostedApp V5 Firmware",
    "fileTypeName": "HostedApp V5 Firmware",
    "deviceTypeName": "Hosted App",
    "fields":{
        "hostedApp": [{
            "value":"250",
            "id":671, 
            "platformParamValues": [],
            "platformType": {
                "name":"hosted_app",
                "id":3,
                "description":"Hosted App"
            },
            "description":"App ID 250"
        }],
       "version": "1.123"
             }
          }
}
 
This API will save the metadata for the file to CTC and create a location for the file to live on AWS. In the response, there is an object called `fields` that will be used to complete part 2 of the upload process.
EXAMPLE RESPONSE:
{
    "response": {
        “results”: [{
            filemeta”: {
                “uploads”: {
                    “data”: {
                        signedUrl”: {
                            “fields”: {
                                “Policy”: "eyJ...="
                                “X-Amz-Algorithm": "AWS4-HMAC-SHA256"
                                “X-Amz-Credential": "AKIAYF3RJRYEAU2OQIVN/20230505/us-east-1/s3/aws4_request"
                                “X-Amz-Date": "20230505T191114Z"
                                “X-Amz-Signature": "3d98527c4d513599efe7a0cc35af68b8a46c4d91c4ef924e14a39780b847fa4c"
                                “bucket”: "dmctc-prd-file-upload"
                                “key”: "ded9a33e-ee13-4acb-9d3c-c69273bcd3ff.dat"
                            }
                        }
                    }
                }
            }
        }]
    }
}
 

1.2        Upload the File contents

Next, you can upload the file contents directly to AWS S3 using the POST API below. Make sure to set the `Content-Type` header to `multipart/form-data`

POST:  https://dmctc-prd-file-upload.s3-accelerate.amazonaws.com/
Headers:

          calamp-services-app: {your_api_key}

          Content-Type: multipart/form-data

 

EXAMPLE BODY:

Body Type:  form-data

 

          key: ded9a33e-ee13-4acb-9d3c-c69273bcd3ff.dat

             Type = Text

          bucket: dmctc-prd-file-upload

             Type = Text

          X-Amz-Algorithm: AWS4-HMAC-SHA256

             Type = Text

          X-Amz-Credential: AKIAYF3RJRYEAU2OQIVN/20230505/us-east-1/s3/aws4_request

             Type = Text

          X-Amz-Date: 20230505T191114Z

             Type = Text

          Policy: eyJ...=

             Type = Text

          X-Amz-Signature: 3d98527c4d513599efe7a0cc35af68b8a46c4d91c4ef924e14a39780b847fa4c 

             Type = Text

          file: {binary}

             Type = File

 

Step 3: File Search

Search for the files to download using the API shown below.  The searchTerms are listed below in the example response, however the most commonly used searchTerms are account and name.  Wildcards can be used in the name parameter.


POST:  https://connect.calamp.com/device-services/files/search

Headers:

          calamp-services-app: {your_api_key}

          Content-Type: application/json

 

EXAMPLE 1 BODY:  Find all files ending in .csv 
{"search": {
     "maxResults": 100,
     "searchTerms": {
            "account": 1110,
            "name": "*.csv"
 }}}
 

 

EXAMPLE 2 BODY:  Find all PEG1 and PEG2 config files
{"search": {
    "maxResults": 100,
    "searchTerms": {            
            "account": 1110,
            "validationMetaData": "{\"platformId\":\"366\"}, {\"platformId\":\"373\"}"
 }}}

 

EXAMPLE 3 BODY:  Find firmware 4.1i for LMU-5530 (AppId 164)
{"search": {
    "maxResults": 100,
    "searchTerms": {            
            "account": 1110,
            "validationMetaData": "{\"fields\":{\"version\":\"41i\",\"appId\":[{\"value\":\"164\"}]}}",
            "validationStatus": "{\"status\": \"VALID\"}"
}}}

 

 

This API will return an array of files that match the search criteria. Find the name, id and href of the file(s) to be downloaded.  These will be required when creating a new job using the APIs in the following sections. See the yellow highlights in the example below.

EXAMPLE RESPONSE:
{
    "response": {
        "searchableProperties": {
            "account (long[])": "",
            "createdOn (date[])": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
            "groups (list[])": "",
            "lastModifiedOn (date[])": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
            "validationStatus (jsonnode[])": "Must be a valid JSON document",
            "id (long[])": "",
            "name (string[])": "",
            "validationMetaData (jsonnode[])": "Must be a valid JSON document"
        },
        "search": {
            "maxResults": 100,
            "searchTerms": {
                "account": "1110",
                "name": "*.csv"
            }
        },
        "queryTime": 295,
        "totalCount": 755,
        "results": [
            {
                "filemeta": {
                    "_self": {
                        "href": "https://internal.connect.calamp.com/connect/services/files/11162",
                        "rel": "self",
                        "status": "Enabled"
                    },
                    "groups": null,
                    "location": "https://dmctc-prd-file-upload...dat",
                    "id": 11162,
                    "description": null,
                    "status": "Enabled",
                    "createdOn": "2021-12-21T18:50:44.929Z",
                    "deletedOn": null,
                    "inheritable": true,
                    "lastModifiedOn": "2021-12-21T18:50:47.021Z",
                    "name": "v144 Equivalent_Modified.csv",
                    "version": 1,
                    "account": {
                        "href": "https://internal.connect.calamp.com/connect/services/accounts/2",
                        "rel": "account",
                        "status": "Enabled",
                        "title": "Calamp Root Account"
                    },
                    "validationMetaData": {
                        "Bucket": "dmctc-prd-file-upload",
                        "fields": {
                            "vBus": [
                                {
                                    "id": 7,
                                    "value": "JPOD2 v2.1.0 (revB RS232)",
                                    "description": "VBus Platform \"JPOD2 v2.1.0 (revB RS232)\""
                                }
                            ],
                            "version": "001"
                        },
                        "DataKey": "fab622de-....dat",
                        "DataUrl": "https://dmctc-prd-file-upload....dat",
                        "NotesUrl": "https://dmctc-prd-file-upload.s3....notes",
                        "fileTypeId": "1",
                        "platformId": "761",
                        "deviceTypeId": "8",
                        "fileTypeName": "Config",
                        "platformName": "JPOD2 Config",
                        "deviceTypeName": "JPOD2",
                        "releaseNotesUrl": "",
                        "releaseNoteAttached": false
                    },
                    "validationStatus": {
                        "status": "VALID",
                        "reasons": null
                    },
                    "type": null
                }
            }, ...

 

 

Step 4: Job Creation

Use the Create Job API to schedule the file download at the device’s next check in.  The example below contains two files to download to a single unit. Simply add additional tasks to the array if more files need to be scheduled. The smartSearch criteria to choose which LMUs are included in the job is very flexible.  A smart search can search on deviceId, ESN, groupName, groupId, device name and many more options.  There are several examples of different ways to use the smartSearch criteria in Appendix B of this document.

The items highlighted in yellow below will need to be updated with specific information for your job.  The name field is required to be unique for each job created.

POST: https://connect.calamp.com/device-services/jobs

Headers:

          calamp-services-app: {your_api_key}

          Content-Type: application/json

 

EXAMPLE BODY: 
{
  "job": {
    "criteria": [
      {
        "smartSearch": {
          "queryString": "id: (940719)",
          "type": "device",
          "hierLevel": "ALL",
          "accountId": 1110
        }
      }
    ],
    "status": "Enabled",
    "progressStatus": "Pending",
    "account": {
      "href": "https://connect.calamp.com/connect/services/accounts/1110",
      "rel": "self",
      "title": "CalAmp Solutions Group (CSG)",
      "status": "Enabled"
    },
    "name": "SampleJob-1001",
    "description": "Sending LMU FW and Config",
    "tasks": [
      {
        "task": {
          "taskType": "File",
          "name": "task_0",
          "description": "",
          "status": "Enabled",
          "progressStatus": "Pending",
          "metaData": {
            "file": "https://internal.connect.calamp.com/connect/services/files/12712",
            "title": "LMU-LTE-446-84a.bin",
            "fileAction": "Overwrite"
          }
        }
      },
      {
        "task": {
          "taskType": "File",
          "name": "task_1",
          "description": "",
          "status": "Enabled",
          "progressStatus": "Pending",
          "metaData": {
            "file": "https://internal.connect.calamp.com/connect/services/files/23534",
            "title": "100.86-LMU3640_RapidReporting",
            "fileAction": "Overwrite"
          }
        }
      }
    ]
  }
}

 

EXAMPLE RESPONSE:
{
    "response": {
        "searchableProperties": {
            "account (long[])": "",
            "createdOn (date[])": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
            "groups (list[])": "",
            "lastModifiedOn (date[])": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
            "status (resourcestatus[])": "Enabled,Disabled,Suspended,Deleted",
            "progressStatus (jobtaskstatus[])": "Pending, InProgress, Failed, Completed, CompletedExc, Cancelled, InProgressCancelled, Created, Validating, Validated, ValidatedExc, Cancelling",
            "id (long[])": "",
            "name (string[])": ""
        },
        "results": [
            {
                "job": {
                    "_self": {
                        "href": "https://internal.connect.calamp.com/connect/services/jobs/43344",
                        "rel": "self",
                        "status": "Enabled"
                    },
                    "groups": null,
                    "version": 0,
                    "criteria": [
                        {
                            "smartSearch": {
                                "hierLevel": "ALL",
                                "type": "device",
                                "queryString": "id: (940719)",
                                "accountId": 1110
                            }
                        }
                    ],
                    "account": {
                        "href": "https://internal.connect.calamp.com/connect/services/accounts/1110",
                        "rel": "account",
                        "status": "Enabled",
                        "title": "CalAmp Solutions Group (CSG)"
                    },
                    "schedule": null,
                    "tasks": [
                        {
                            "task": {
                                "_self": {
                                    "href": "https://internal.connect.calamp.com/connect/services/jobs/43344/tasks/0",
                                    "rel": "self",
                                    "status": "Enabled",
                                    "title": "task_0"
                                },
                                "description": null,
                                "index": 0,
                                "status": "Enabled",
                                "createdOn": "2023-01-09T22:58:24.603Z",
                                "deletedOn": null,
                                "lastModifiedOn": "2023-01-09T22:58:24.603Z",
                                "taskType": "File",
                                "name": "task_0",
                                "version": 0,
                                "job": null,
                                "criteria": null,
                                "metaData": {
                                    "file": "https://internal.connect.calamp.com/connect/services/files/12712",
                                    "title": "LMU-LTE-446-84a.bin",
                                    "fileAction": "Overwrite"
                                },
                                "progressStatus": "Pending",
                                "counts": {
                                    "completed": null,
                                    "pending": null,
                                    "failed": null,
                                    "total": null,
                                    "cancelled": null
                                }
                            }
                        },
                        {
                            "task": {
                                "_self": {
                                    "href": "https://internal.connect.calamp.com/connect/services/jobs/43344/tasks/1",
                                    "rel": "self",
                                    "status": "Enabled",
                                    "title": "task_1"
                                },
                                "description": null,
                                "index": 1,
                                "status": "Enabled",
                                "createdOn": "2023-01-09T22:58:24.603Z",
                                "deletedOn": null,
                                "lastModifiedOn": "2023-01-09T22:58:24.603Z",
                                "taskType": "File",
                                "name": "task_1",
                                "version": 0,
                                "job": null,
                                "criteria": null,
                                "metaData": {
                                    "file": "https://internal.connect.calamp.com/connect/services/files/23534",
                                    "title": "100.86-LMU3640_RapidReporting",
                                    "fileAction": "Overwrite"
                                },
                                "progressStatus": "Pending",
                                "counts": {
                                    "completed": null,
                                    "pending": null,
                                    "failed": null,
                                    "total": null,
                                    "cancelled": null
                                }
                            }
                        }
                    ],
                    "id": 43344,
                    "description": "Sending LMU FW and Config",
                    "status": "Enabled",
                    "createdOn": "2023-01-09T22:58:24.602Z",
                    "deletedOn": null,
                    "lastModifiedOn": "2023-01-09T22:58:24.602Z",
                    "progressStatus": "Pending",
                    "name": "SampleJob-1001"
                }
            }
        ]
    }
}

 

Appendix A:  DeviceTypes & FileTypes

The available deviceTypeId, fileTypeId, and platformId can be retrieved from the following API.

GET: https://connect.calamp.com/device-services/platform/deviceTypes

Headers:

          calamp-services-app: {your_api_key}

          Content-Type: application/json

 

Calling the API above will allow the user to retrieve the most up to date list of files that can be downloaded to LMUs.  For simplicity, the table below can be used as reference as well, but may not contain the most up to date information.

The “Required inputsFields” column in the table below specifies what information must be supplied when creating the metadata.fields JSON object in the Create File Metadata API of section 2.1.  If CalAmp Only is listed in this column then this filetype can only be uploaded by CalAmp personnel.  However, all other filetypes can be uploaded by customers.  Parameters such as “version” and “reportedName” are simply strings defined by the user who is uploading the file.  Others like vBus, hostedApp, and appId are JSON collections that need to be looked up and copied from the appropriate CTC API which are shown in the Required inputFields column in the table below. 

Call the listed API in the table and then select the desired JSON object from the response to include in the Create File Meta API.

deviceTypeName

deviceTypeId

fileTypeName

fileTypeId

platformName

platformId

Required inputsFields when Creating File Metadata

LMU

0

Firmware

0

LMU Firmware

365

CalAmp Only

LMU

0

Config

1

LMU Config

366

version

LMU

0

Database (Driver ID)

9

LMU Database (Driver ID)

367

version

LMU

0

GeoZones

11

LMU GeoZones

368

version

LMU

0

APN List

15

LMU APN List

369

version

LMU

0

Digital Signature Keys

18

LMU Digital Signature Keys

370

version

LMU

0

PEG2

22

LMU PEG2

373

version

LMU

0

LMU BSP Modem

25

LMU BSP Modem

767

version

JPOD

1

Firmware

0

JPOD Firmware

374

CalAmp Only

JPOD

1

Config

1

JPOD Config

375

version, vBus

(GET https://connect.calamp.com/device-services/platforms/types/vbus_platform)

JPOD

1

VBusHostedApp

10

JPOD VBusHostedApp

376

version, vBus

(GET https://connect.calamp.com/device-services/platforms/types/vbus_platform)

Hosted App

3

Firmware

0

Hosted App Firmware

381

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

Firmware First Peripheral

5

Hosted App Firmware First Peripheral

383

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

Config First Peripheral, Hosted App

6

Hosted App Config First Peripheral, Hosted App

384

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

Firmware 2nd Peripheral

7

Hosted App Firmware 2nd Peripheral

385

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

Config 2nd Peripheral, Hosted App

8

Hosted App Config 2nd Peripheral, Hosted App

386

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

HostedApp V2 Firmware

14

Hosted App HostedApp V2 Firmware

387

version, hostedApp

 (GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

HostedApp V3 Firmware

16

Hosted App HostedApp V3 Firmware

389

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

HostedApp V4 Firmware

17

Hosted App HostedApp V4 Firmware

390

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

HostedApp V6 Firmware

16

Hosted App HostedApp V6 Firmware

392

version, hostedApp

(GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

Hosted App

3

HostedApp V5 Firmware

21

Hosted App HostedApp V5 Firmware

391

version, hostedApp (GET https://connect.calamp.com/device-services/platforms/types/hosted_app)

OBD II Type II

4

Firmware

0

OBD II Type II Firmware

393

version, vBus

(GET https://connect.calamp.com/device-services/platforms/types/vbus_platform)

OBD II Type II

4

Database OBD II

4

OBD II Type II Database OBD II

394

version, vBus

(GET https://connect.calamp.com/device-services/platforms/types/vbus_platform)

Android MDT

6

Firmware

0

Android MDT Firmware

396

CalAmp Only

Android MDT

6

Config

1

Android MDT Config

397

version, reportedName

BT

7

Firmware

0

BT Firmware

398

CalAmp Only

JPOD2

8

Firmware

0

JPOD2 Firmware

399

CalAmp Only

JPOD2

8

Config

1

JPOD2 Config

761

version, vBus

(GET https://connect.calamp.com/device-services/platforms/types/vbus_platform)

BLE

9

Firmware

0

BLE Firmware

400

CalAmp Only

Linux

10

OPKG

12

Linux OPKG

402

version, reportedName, appId

(GET https://connect.calamp.com/device-services/platforms/types/app_id)

Linux

10

LinuxCustom

13

Linux LinuxCustom

403

version, reportedName, appId

(GET https://connect.calamp.com/device-services/platforms/types/app_id)

Co-Processor

12

Firmware

0

Co-Processor Firmware

781

CalAmp Only

Bluetooth FOB

13

Firmware

0

Bluetooth FOB Firmware

404

CalAmp Only

Cell Radio

14

Firmware

0

Cell Radio Firmware

405

CalAmp Only

BLE Central

15

Firmware

0

BLE Central  Firmware

406

CalAmp Only

ublox ODIN

16

Firmware

0

ublox ODIN Firmware

407

CalAmp Only

BT BlueRadios

18

Firmware

0

BT BlueRadios Firmware

410

CalAmp Only

Security BLE

21

Firmware

0

Security BLE Firmware

415

CalAmp Only

BLE2-TI-CC2640

22

Firmware

0

BLE2-TI-CC2640 Firmware

416

CalAmp Only

VLU10-App-Processor

23

Firmware

0

VLU10-App-Processor Firmware

417

CalAmp Only

VLU10-BLE

24

Firmware

0

VLU10-BLE Firmware

418

CalAmp Only

VBU3

25

Firmware

0

VBU3 Firmware

419

CalAmp Only

BLE3

26

Firmware

0

BLE3 Firmware

420

CalAmp Only

BLE2 with SPS

27

Firmware

0

BLE2 with SPS Firmware

421

CalAmp Only

EdgeApp

30

Firmware

0

EdgeApp Firmware

825

version, reportedName, appId

(GET https://connect.calamp.com/device-services/platforms/types/app_id)

 

If you want to use CTC directly to determine the required inputFields, the parameters and URL for the required inputFields can be determined from the JSON returned in the /platform/deviceTypes API listed at the beginning of this appendix.

 

Sample /device-services/platform/deviceTypes JSON response:

 

{

    "id": "21",

    "name": "HostedApp V5 Firmware",

    "deviceTypeId": "3",

    "platformName": "Hosted App HostedApp V5 Firmware",

    "platformId": "391",

    "fileInheritable": {

        "inheritable": false,

        "override": true

    },

    "fileEntityType": "CustomerFile",

    "downloadable": true,

    "fileMetaType": {

        "subType": "hostedapp",

        "category": "custompackages"

    },

    "inputFields": [

        {

            "name": "version",                 <-------Parameter to include

            "type": "String",                  <-------This parameter is just a user defined string

            "label": "File Version",

            "required": true,                  <-------Field is required

            "multiple": false,

            "showOnEdit": false

        },

        {

            "name": "hostedApp",                <-------Parameter to include

            "type": "lookup",                   <-------Need to look up the collection.

            "label": "Hosted App ID",

            "required": true,                   <-------Field is required

            "multiple": false,                  <-------Only one can be entered

            "showOnEdit": false,

            "lookup": {

                "urlMapping": "/dm/platforms/types/hosted_app",   <-------URL hint to find collection.

                "queryString": "",

                "valueMapping": {

                    "type": "Platform",

                    "outputFieldNames": [

                        "id",          <-------Required to be included from collection for hosted_app.

                        "value",       <-------Required to be included from collection for hosted_app.

                        "description"  <-------Required to be included from collection for hosted_app.

 

                    ],

                    "displayValue": "description",

                    "outputValue": "value"

                }

            }

        }

    ]

}

        

The urlMapping parameter above will give us a hint to retrieve the data for this API:

GET: https://connect.calamp.com/device-services/platforms/types/hosted_app

Headers:

          calamp-services-app: {your_api_key}

          Content-Type: application/json

 

You will get the JSON response shown below and you will need to retrieve the information from the App ID that matches the hosted app that you have compiled.  Typically customers use App IDs 250 to 255 for hosted apps.

Sample /platforms/types/hosted_app JSON response:

 

[

    {

        "value": "1",

        "id": 422,

        "platformType": {

            "name": "hosted_app",

            "id": 3,

            "description": "Hosted App"

        },

        "platformParamValues": [],

        "description": "App ID 1"

    },

 

 

{

        "value": "250",

        "id": 671,

        "platformType": {

            "name": "hosted_app",

            "id": 3,

            "description": "Hosted App"

        },

        "platformParamValues": [],

        "description": "App ID 250"

    },

 

    {

        "value": "255",

        "id": 676,

        "platformType": {

            "name": "hosted_app",

            "id": 3,

            "description": "Hosted App"

        },

        "platformParamValues": [],

        "description": "App ID 255"

    }

]

 

 

 

 

So if we translate the information in the example above into the metadata.fields JSON to be included in the file POST /files API it will look like the example below.  Please note, the example below also includes additional information that can be included if desired.
The deviceTypeId, fileTypeId, platformId, platformName, fileTypeName, and deviceTypeName parameters will always be required.

"metadata": {
    "deviceTypeId":"3",                                
    "fileTypeId":"21",                                 
    "platformId":"391",
    "platformName":"Hosted App HostedApp V5 Firmware",
    "fileTypeName": "HostedApp V5 Firmware",
    "deviceTypeName": "Hosted App",
    "fields":{
        "hostedApp": [{                                <-------Required parameter to include
            "value":"250",                             <-------Required parameter to include
            "id":671,                                  <-------Required parameter to include
            "platformParamValues": [],                   <-------optional
            "platformType": {                            <-------optional 
                "name":"hosted_app",                     <-------optional
                "id":3,                                  <-------optional
                "description":"Hosted App"               <-------optional
            },                                           <-------optional
            "description":"App ID 250"                 <-------Required parameter to include
        }],
       "version": "1.123"                  <-------Required parameter to include (user defined)
             }
          }

 

 

Appendix B:  SmartSearch

1.1        SmartSearch Example Formats

The examples below can be inserted in the “criteria” array in the POST jobs API.

Example

Search Body

Search for a specific ESN.

{ "smartSearch": {

       "queryString": "4562211953",

        "type": "device",
        "accountId": 1110,
        "hierLevel": "All"

 }}

Request all the devices in an account and its subaccounts.

{ "smartSearch": {
        "queryString": "*",

        "type": "device",
        "accountId": 1110,
        "hierLevel": "All"
}}

Request multiple devices.

{ "smartSearch": {
       "queryString": "esn: (4562211953 OR 1110000305 OR 3671000349)",

       "type": "device",
        "accountId": 1110,
        "hierLevel": "All"
}}

Request all the devices in group 4650.

{ "smartSearch": {
         "queryString": "groupIds: (4650)",

         "type": "device",
         "accountId": 1110,
         "hierLevel": "All"
}}

Request all the devices with a name containing "demo."

{ "smartSearch": {
        "queryString": "name: (demo)",

        "type": "device",
        "accountId": 1110,
        "hierLevel": "All"
}}

Request all the devices with firmware 8.4a or 8.6c.

{ "smartSearch": {
          "queryString": "extensions.firmwareVersion: (84a OR 86c)",

          "type": "device",
          "accountId": 1110,
          "hierLevel": "All"
}}


 

1.2        SmartSearch Searchable Properties


The list below is the current list of properties that can be searched on using the smartSearch criteria.  This list may be updated in the future.

 

Property Name

Type

Comments

account

long[]

 

extensions.firmwareVersion

string[]

 

extensions.networkMode

string[]

 

schedules.title

string[]

 

replacedDevice.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

asset.id

long[]

 

pegBehaviorId

long[]

 

mdn

string[]

Searchable without property name

type.title

string[]

 

replacedDevice.id

long[]

 

ipAddress

string[]

Searchable without property name

activationDate

date[]

yyyy-MM-dd'T'HH:mm:ss.SSSZ,

asset.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

account.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

name

string[]

Searchable without property name

pegBehavior.title

string[]

 

asset.title

string[]

 

pegBehavior

long[]

 

extensions.platforms

string[]

 

pegBehavior.id

long[]

 

userESN

string[]

Searchable without property name

deviceConfigurationId

long[]

 

groups.id

long[]

 

lastModifiedOn

date[]

yyyy-MM-dd'T'HH:mm:ss.SSSZ

pegBehavior.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

provisionStatus

string[]

 

status

resourcestatus[]

 

schedules.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

serialNumber

string[]

Searchable without property name

userDefinedMobileId

string[]

Searchable without property name

extensions.vbusEnabledStatus

string[]

 

extensions.poNumber

string[]

 

category

devicecategory[]

 

createdOn

date[]

yyyy-MM-dd'T'HH:mm:ss.SSSZ

architecture

devicearchitecture[]

 

extensions.shippingOrder

string[]

 

extensions.networkCarrier

string[]

 

extensions.androidOSVersion

string[]

 

deviceConfiguration.title

string[]

 

esn

string[]

Searchable without property name

iccid

string[]

Searchable without property name

typeId

long[]

 

airId

string[]

Searchable without property name

groupIds

list[]

 

dmDevice

boolean[]

 

deviceConfiguration.id

long[]

 

extensions.signalStrength

string[]

 

lastReportedTime

date[]

yyyy-MM-dd'T'HH:mm:ss.SSSZ

account.title

string[]

 

accountId

long[]

 

imei

string[]

Searchable without property name

extensions.configVersion

string[]

 

extensions.vbusMode

string[]

 

ioProfile.title

string[]

 

account.id

long[]

 

id

long[]

Searchable without property name

serviceProfile.id

long[]

 

extensions.sku

string[]

 

externalId

string[]

Searchable without property name

groups.title

string[]

 

extensions.kernelVersion

string[]

 

macAddress

string[]

Searchable without property name

shipDate

date[]

yyyy-MM-dd'T'HH:mm:ss.SSSZ

typeName

string[]

 

deviceConfiguration

long[]

 

serviceProfile.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

extensions.esnAssociatedLMU

string[]

Searchable without property name

groups

list[]

 

type.id

long[]

 

replacedDevice.title

string[]

 

schedules.id

long[]

 

ioProfile.id

long[]

 

meid

string[]

Searchable without property name

type

long[]

 

extensions.idReportTimestamp

date[]

 

extensions.networkCurrentMode

string[]

 

extensions.fileVersions

string[]

 

extensions.appId

string[]

 

min

long[]

Searchable without property name

extensions.associatedDevices

string[]

 

imsi

string[]

Searchable without property name

serviceProfile.title

string[]

 

ioProfile.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

extensions.batteryPercentageLeft

integer[]

Searchable without property name

groups.status

resourcestatus[]

Enabled,Disabled,Suspended,Deleted,Pending_Delete

phoneNumber

string[]

Searchable without property name

 

Appendix C: Permissions

A CTC user that is exercising API calls should utilize a custom Application (eg. API key).  Each API Key must have at least one or more roles associated with it.  When a user is allowed access to a given Application they are also assigned a role.  The role dictates the permissions available to the user when they use that API key.

Within the role there are “Assign” permissions that will allow a user to schedule certain filetypes to be pushed to an LMU or remote device over the air.  The assign permissions are listed in the table below along with the file type or file types that are allowed when each permission is enabled.

CTC Admin Feature

CTC Admin Permission

File Description

DeviceType ID

FileType ID

Platform ID

Bluetooth (BLE/BT all 8)

Bluetoothfirmware

BT Firmware
BLE Firmware
Bluetooth FOB Firmware

BLE Central Firmware

BT BlueRadios Firmware

Security BLE Firmware

BLE2-TI-CC2640 Firmware

BLE3 Firmware

BLE2 with SPS Firmware

7

9

13

15

18

21

22

26

27

0

0

0

0

0

0

0

0

0

398

400

404

406

410

415

416

420

421

Customer Database Files (DriverID, Geozone, APN list)

Customerdatabaseapn

LMU APN List

0

15

369

Customer Database Files (DriverID, Geozone, APN list)

Customerdatabasedriverid

LMU Database (Driver ID)

0

9

367

Customer Database Files (DriverID, Geozone, APN list)

Customerdatabasegeozone

LMU GeoZones

0

11

368

HostedApp and EdgeApp and OPKGS

Custompackagesedgeapp

EdgeApp Firmware

30

0

825

HostedApp and EdgeApp and OPKGS

Custompackageshostedapp

Hosted App Firmware

Hosted App Firmware First Peripheral

Hosted App Config First Peripheral

Hosted App Firmware 2nd Peripheral

Hosted App Config 2nd Peripheral

Hosted App HostedApp V2 Firmware

Hosted App HostedApp V3 Firmware

Hosted App HostedApp V4 Firmware

Hosted App HostedApp V6 Firmware

Hosted App HostedApp V5 Firmware

3

3

3

3

3

3

3

3

3

3

0

5

6

7

8

14

16

17

16

21

381

383

384

385

386

387

389

390

392

391

HostedApp and EdgeApp and OPKGS

Custompackagesopkg

Linux OPKG

Linux LinuxCustom

10

10

12

13

402

403

KeyFiles (Assigning only)

Lmudigitalsignature

LMU Digital Signature Keys

0

18

370

LMU Firmware and Co-Processor

Lmufirmware

LMU Firmware

Co-Processor Firmware

0

12

0

0

365

781

Script (PEG and PEG2)

Lmuscript

LMU Config

LMU PEG2

0

0

1

22

366

373

MDT

Mdtconfig

Android MDT Config

6

1

397

MDT

Mdtfirmware

Android MDT Firmware

6

0

396

Radio FW (Including BSP)

Radiofirmware

Cell Radio Firmware

LMU BSP Modem

ublox ODIN Firmware

14

0

16

0

25

0

405

767

407

VBus

Vbusconfig

JPOD Config

JPOD2 Config

1

8

1

1

375

761

VBus

Vbusfirmware

JPOD Firmware

OBD II Type II Firmware

OBD II Type II Database OBD II

JPOD2 Firmware

VBU3 Firmware

1

4

4

8

25

0

0

4

0

0

374

393

394

399

419

VBus

Vbushostedapp

JPOD VBusHostedApp

1

10

376

 

© 2023 CalAmp