Get a list of devices excluded from location service:

GET /consents/{account}/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 you can exclude devices (and include them again) with a POST /consents request.

Contents

See also:
Exclude Devices
Remove devices from the Exclusion list

Uses and Requirements

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), you must send additional requests to retrieve the rest of the list. Use the startIndex parameter to return a different set of devices in each response.

Request Components

HTTP Request

GET https://thingspace.verizon.com/api/loc/v1/consents/{account}/index/{startIndex}

Resource Path and Query Parameters

You must include the account name in the path, and the startIndex to specify the starting record.

Parameter Name Data Type Description
account
required
string The name of the account for which you want to get the list of excluded devices. An account name is usually in the format of 10 digits, a hyphen, and then five more digits. 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 is true in the response, use the startIndex value from the response for the next request.

Header Parameters

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

Parameter Name Data Type Description
Authorization
required
string HTTP Authorization bearer token.
VZ-M2M-Token
required
string A valid session token returned by POST /api/m2m/v1/session/login.

Request Body

None.

Success Responses

Status 200

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 may be ESNs, MEIDs, or IMEIs.

Parameter Name Data Type Description
accountName string The billing account that you requested exclusion information for.
allDevice boolean True if all devices in the account are excluded.
hasMoreData Boolean True if there are more excluded devices to retrieve.
totalCount integer The total number of excluded devices. Note that each response includes a maximum of 2,000 devices.
exclusion array of strings A list of identifiers of the devices that are excluded from location service.
updateTime string The time that the consent (exclusion) list was last changed.

Example Success Response

{
  "accountName": "2024009649-00001",
  "allDevice": false,
  "hasMoreData": false,
  "totalCount": 4,
  "updateTime": "2018-05-18 19:20:50.076 +0000 UTC",
  "exclusion": [ 
    "990003420535375",
    "420535399000375",
    "A100003861E585",
    "205353759900034"
  ]
}

Failure Responses

Status 400

All error messages are returned in this format:

{
  "errorCode": "The type of error, such as INVALID_REQUEST.",
  "errorMessage": "Additional error information."
}

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