Exclude Devices

Exclude devices from location service:
POST /consents

Creates or appends to a list of devices to be excluded from the location service, or excludes all devices in an account. Attempting to locate an excluded device with a POST /locations or a POST /locationreports request will return an error.

Contents

See also:
Get a list of excluded devices
Remove devices from the Exclusion list

Uses and Requirements

To remove devices from the exclusion list, send a request that does not include those devices and that does not include type = append. The list of devices in that request will replace the current list.

The maximum number of devices that you can exclude is 2,000. (You can exclude all devices in an account by setting allDevice to true.)

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/loc/v1/consents

Resource Path and Query Parameters

None.

Header Parameters

The request header must contain a current ThingSpace authorization bearer token and a valid VZ-M2M session token, and must set the content-type to JSON.

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.
Content-Type
required
string Must be application/json.

Request Body

The body contains the the account number and list of devices that you want to exclude.

Parameter Name Data Type Description
accountName
required
string The name of a billing account, which is usually in the format of 10 digits, a hyphen, and then five more digits. Must include any leading zeros.
type
optional
string Set to “append” to append the devices in the current request to the existing list. If there is no existing list then it will be created with only these devices.
Set to “replace” when you want to replace the existing list with the devices in the current request.
allDevice
optional
boolean Set to true to exclude all devices in the account. To re-enable all devices for location service, set allDevice to false and pass in an empty array for the exclusion list.
exclusion
optional
array of strings A list of one hardware identifier for each device that you want to exclude from location service. You can use IMEI, MEID, or ESN.

Example Request Body

{
  "accountName": "1234567890-00001",
  "type": "replace",
  "allDevice": false,
  "exclusion": [ "980003420535573", "375535024300089", "A100003861E585" ]
}

Success Responses

Status 200

A response to a successful request contains a single Boolean value:

{
  "success": true
}

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.

Try It Out!