Get Device Status in a Campaign
# Get Device Status in a Campaign ### `GET /reports/{accountName}/campaigns/{campaignId}/devices` Returns a list of all devices in a campaign and the status of each device. 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. ## HTTP Request [GET https://thingspace.verizon.com/api/fota/v3/reports/{accountName}/campaigns/{campaignId}/devices?lastSeenDeviceId={15-digit IMEI}](/docs/premium-apis/software-management/software-management-v2/api-endpoints/software-management-reports-v2/getcampaigndevicestatus) ## Request Parameters The `accountName` and `campaignId` must be included in the path. |Parameter Name|Data Type|Description| |-----|-----|-----| | **accountName** *(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}/{accountName} response when the upgrade was scheduled. | | **lastSeenDeviceId** *(required)* | string | 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. | ## Request Body None. ## Success Response **Status 200** A success response contains the account name and an array of device objects. Example Success Response ```json { "totalDevice":"2689", "hasMoreData":true, "lastSeenDeviceId":"15-digit IMEI", "maxPageSize":1000, "deviceList":[ { "deviceId":"15-digit IMEI", "status":"UpgradePending", "resultReason":"Upgrade pending, the device upgrade is estimated to be scheduled for 06 Oct 22 18:05 UTC", "statusTime":"2022-10-05T21:05:27.129Z", "recentAttemptTime":"2022-10-05T21:05:01.19Z", "nextAttemptTime":"2022-10-06T18:35:00Z" }, { "deviceId":"15-digit IMEI", "status":"UpgradePending", "resultReason":"Upgrade pending, the device upgrade is estimated to be scheduled for 06 Oct 22 18:05 UTC", "statusTime":"2022-10-05T21:05:27.129Z", "recentAttemptTime":"2022-10-05T21:05:01.19Z", "nextAttemptTime":"2022-10-06T18:35:00Z" } } ``` **Note:** `hasMoreData = true` means there is more than the first 1000. `lastSeenDeviceId` should be used for pagination. So, to get devices beyond the first 1000, run a follow up API request: `https://thingspace.verizon.com/api/fota/v2/reports/{accountName}/campaigns/{capaignId}/devices?lastSeenDeviceId={last 15-digit IMEI}` ## Success Parameters |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** | string | 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. | | **nextAttemptTime** | string ($date-time) | The timestamp of when the upgrade will be attempted again if it did not succeed. | ## Failure Responses All error messages are returned in this format: ```json { "errorCode": "error code string", "errorMessage": "error message string" } ``` Error codes and messages are listed on the [Error Messages page](https://thingspace.verizon.com/documentation/api-documentation.html#/http/software-management/guides/error-messages), along with explanations and suggestions for corrective actions.