Get Device Status in a Campaign

Get Device Status in a Campaign

GET /reports/{acc}/campaigns/{campaignId}/devices

Returns a list of all devices in a campaign and the status of each device.

Uses and Requirements

Each response includes a maximum of 1,000 devices. If the report contains more than 1,000 devices (indicated by the hasMoreData parameter in each response), you must send additional requests to retrieve the remaining devices. Use the lastSeenDeviceId parameter to return a different set of devices in each response.

Request Components

HTTP Request

GET https://thingspace.verizon.com/api/fota/v3/reports/{acc}/campaigns/{campaignId}/devices

Resource Path and Query Parameters

You must include the account name in the path and campaignId in the resource path.

Parameter Name Data Type Description
acc
required
string The billing name of the account. An account name is usually numeric, and must include any leading zeros.
campaignId
required
string Software upgrade identifier, returned in the “id” value of the POST /{campaigns}/acc response when the upgrade was scheduled..
lastSeenDeviceId
(query)
integer Only return devices with IMEIs larger than this value. Use 0 for the first request. If hasMoreData=true in the response, use the lastSeenDeviceId value from the response in the next request.

Header Parameters

The request header must contain a current ThingSpace authorization token and a current VZ-M2M-session token.

Parameter Name Data Type Description
Authorization
required
string HTTP Authorization request header containing a valid Bearer token.
VZ-M2M-Token
required
string A valid session token returned by a Connectivity Management POST /session/login request.

Request Body

None.

Example Request

Request the list of devices for an account:

curl https://thingspace.verizon.com/api/fota/reports/$ACC/campaigns/$CAMPAIGN_ID/devices  -H 'Authorization: Bearer $AUTH_TOKEN' -H 'VZ-M2M-Token: $M2M_TOKEN'

Success Responses

Status 200

A success response contains the account name and an array of device objects.

Parameter Name Data Type Description
totalDevice string The total number of devices in the campaign.
hasMoreData Boolean True if there are more devices to retrieve.
lastSeenDeviceId integer If hasMoreData=true, use this value for the next request. 0 if hasMoreData=false.
maxPageSize integer Maximum number of results included in the response.
deviceList array  
   deviceId string The IMEI of the device.
   status string The upgrade status of the device, either UpgradeSuccess or upgradeFailure.
   resultReason string The reason for the upgrade status.
   updatedTime string($date-time) The system timestamp associated with this status.
   recentAttemptTime string($date-time) The timestamp of when the upgrade was attempted if the it did not succeed.
   nextAttemptTime string($date-time) The timestamp of when the upgrade will be attempted again if the it did not succeed.

 

Example Success Response

{

    "totalDevice": "1",
    "hasMoreData": false,
    "lastSeenDeviceId": "0",
    "maxPageSize": 1000,
    "deviceList": [
        {
            "deviceId": "354658090353977",
            "status": "NoDeviceDataFromNetwork",
            "resultReason": "The network reports this device is not reachable.",
            "updatedTime": "2021-09-29T19:01:37.152Z",
            "recentAttemptTime": "2021-09-29T19:01:36.987Z",
            "nextAttemptTime": "2021-09-29T19:40:00Z"
        }
    ]
}

Failure Responses

Status 400

All error messages are returned in this format:

 {
   "errorCode": "error code string",
   "errorMessage": "error message string"
}

Error codes and messages are listed on the Error Messages page, along with explanations and suggestions for corrective actions.