Premium APIsDevice LocationAPI Reference

Retrieve a Device Location Report

Retrieve a Completed Location Report

GET /locationreports/{accountName}/report/{txid}/index/{startindex}

Returns a generated device location report that was created with a POST /locationreports request. Reports are available for 30 days once generated. 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), send additional requests to retrieve the remaining devices. 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.

Parameter NameData TypeDescription
Authorization (required)stringHTTP Authorization bearer token: Authorization: Bearer {token}
VZ-M2M-Token (required)stringA valid session token: VZ-M2M-Token: {M2Mtoken}
Content-Type (required)stringMust be application/json Content-Type: application/json

HTTP Request

GET https://thingspace.verizon.com/api/loc/v1/locationreports/{accountName}/report/{txid}/index/{startindex}

Request Parameters

The accountName and transaction ID (txid) must be included in the path to identify the report as well as the startIndex to specify the starting record.

Parameter NameData TypeDescription
accountName (required)stringThe numeric name of the account that the report was requested for.
txid (required)stringThe transaction ID from the POST /locationreports response. This si a 32 or 36-bit UUID.
startIndex (required)integerThe zero-based number of the first record to return. Set "startIndex": "0" for the first request. If there are more than 1,000 devices to be returned ("hasMoreData": true), set "startIndex": "1000" for the second request and "startIndex": "2000" for the third request, and so on, until all records are retrieved.

Request Body

None.

Success Response

Status 200 A success response includes information about the report itself (transaction ID, number of device records returned and which page is displayed) and an array of objects, each containing the position data or an error for a device in the request. Example Success Response

{
  "startIndex":"0",
  "txid":"2017-12-11Te8b47da2-eeee-ffff-gggg-61815e1e97e9",
  "totalCount":"3",
  "hasMoreData":false,
  "devLocationList":[
    {  
      "error": {},
      "msid": "10-digit phone number",
      "pd":{  
        "qos": "false",
        "radius": "5571",
        "time": "20170520004421",
        "x": "33.45324",
        "y": "-84.59621"
      }
    },
    {  
      "error": {},
      "msid": "10-digit phone number",
      "pd":{  
        "qos": "false",
        "radius": "3866",
        "time": "20170525214342",
        "x": "38.8408694",
        "y": "-105.0422583"
      }
    },
    {  
      "error": {  
        "time": "20170525214342",
        "type": "POSITION METHOD FAILURE",
        "info": "Exception code=ABSENT SUBSCRIBER"
      },
      "msid": "10-digit phone number",
      "pd": {}
    }
  ]
}

Success Parameters

Property NameData TypeDescription
startIndexstringIf "hasMoreData": true, add 1000 to this value to use for startIndex in the next request to retrieve the next block of 1000 locations in the report.
txidstringThe transaction ID of the report.
totalCountintegerThe total number of devices in the request and in the report. Note: Each response includes a maximum of 1000 devices.
hasMoreDataBooleanThis will be true if there are more device locations to retrieve. If there are less than 1000 total devices, this will be false.
devLocationListarrayDevice location information.
msidstringThe Mobile Services ID of the device. This is a 10-digit phone number.
pdobjectPosition data. This will be empty if position data is not available for the device.
xstringThe X coordinate (latitude) of the device in decimal degree format.
ystringThe Y coordinate (longitude) of the device in decimal degree format.
radiusstringThe radius of the location precision, in meters. A smaller radius indicates a more precise location.
qosboolean (Future use)Indicates if the Quality of Service (QoS) target is met. Default is currently false.
timestringThe time that the location was reported. If the request was for “cached or current” information, there will be a cacheMode value that will indicate whether the time at the location is cached (2), cached or current (1) or current data (0).
utcoffsetstringThe UTC offset of the time; omitted if the offset is 0.
errorobjectPosition error. This will be empty if there was no error; if there is an error, this object will contain the error type, information about the error and the time the error ocurred. If the location was not retrieved because it was offline, an error appears. However,ThingSpace will attempt to retrieve a location as soon as it is reachable.
typestringThe error type.
infostringAdditional error information.
timestringThe time that the error was reported.
utcoffsetstringThe UTC offset of the time, omitted if the offset is 0.

Failure Responses

All error messages are returned in this format:

{
  "errorCode": "The 3-digit HTML error code",
  "errorMessage": "string"
}

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

On this page