Get Excluded Devices List
# Get a list of devices excluded from location service ### `GET /consents/{accountName}/index/{startIndex}` Returns the list of devices in the account that have been excluded from location services. (A `POST /locations` request will return an error for excluded devices.) All IoT devices in an account are eligible for location services by default, but devices can be exclude (and included again) with a `POST /consents` request. Each response includes a maximum of 2,000 devices. If the account has more than 2,000 excluded devices (indicated by the hasMoreData parameter in each response), additional requests must be sent to retrieve the rest of the list. Use the `startIndex` parameter to return a different set of devices in each response. ## Header Parameters The request header must set the content-type to JSON, contain a current ThingSpace authorization token and a current VZ-M2M session token. For more details on how to get these tokens, visit [Getting Started](https://thingspace.verizon.com/documentation/api-documentation.html#/http/session-management/guides/getting-started). | Parameter Name | Data Type | Description | | ------------------------------ | --------- | ---------------------------------------------------------------- | | **Authorization** *(required)* | string | HTTP Authorization bearer token: `Authorization: Bearer {token}` | | **VZ-M2M-Token** *(required)* | string | A valid session token: `VZ-M2M-Token: {M2Mtoken}` | | **Content-Type** *(required)* | string | Must be application/json `Content-Type: application/json` | ## HTTP Request [GET https://thingspace.verizon.com/api/loc/v1/consents/{accountName}/index/{startIndex}](/docs/premium-apis/device-location/api-endpoints/exclusions/listexcludeddevices) ## Request Parameters You must include the `accountName` and the `startIndex` in the path to specify the starting record. |Parameter Name|Data Type|Description| |-----|-----|-----| | **accountName** *(required)* | string | The numeric name of the account. Must include any leading zeros. | | **startIndex** *(required)* | integer | The zero-based number of the first record to return. Set `startIndex=0` for the first request. If `hasMoreData = true` in the response, use the `startIndex` value from the response for the next request. | ## Request Body None. ## Success Responses **Status 200** Example Success Response ```json { "accountName": "0000123456-00001", "allDevice": false, "hasMoreData": false, "totalCount": 4, "updateTime": "2024-07-29 19:20:50.076 +0000 UTC", "exclusion": [ "900000000000009", "900000000000019", "900000000000029", "900000000000039" ] } ``` ## Success Parameters A success response includes a JSON array that contains the hardware identifiers of all excluded devices, or a Boolean indicating that all devices in the account are excluded. The identifiers are IMEIs. |Parameter Name|Data Type|Description| |-----|-----|-----| | **accountName** | string | The billing account that exclusion information was requested from. | | **allDevice** | boolean | This value will be **true** if all the devices in the account are excluded. | | **hasMoreData** | boolean | If there are more excluded devices to retrieve, this will be **true**. | | **totalCount** | integer | The total number of excluded devices. **Note:** Each response includes a maximum of 2,000 devices. | | **exclusion** | array | A list of identifiers of the devices that are excluded from location service. These are **IMEI** values. | | **updateTime** | string | The time that the consent (exclusion) list was last changed. | ## Failure Responses All error messages are returned in this format: ```json { "errorCode": "The 3-digit HTML error code", "errorMessage": "string" } ``` Error codes and messages are listed on the [Error Codes page](https://thingspace.verizon.com/documentation/api-documentation.html#/http/device-location/error-codes), along with explanations and suggestions for corrective actions.