CAS - Coarse Location Support

There are no additional configuration steps required to make the CAS device fall back to reporting coarse location in the absence of GPS/GNSS coverage.

Location Reporting via API

The API request to retrieve the device sensor values (current or history) for a specific sensor “fieldname” is given below.

POST /devices/fields/{fieldname}/actions/history

The above API and its request/response formats are detailed in the page referenced by the following link: https://thingspace.verizon.com/resources/documentation/cloudconnector/API_Reference/Get_Sensor_History/


In the retrieve sensor history POST API call listed above, to obtain device location, the “{fieldname}” is replaced with “location” as written below:

POST /devices/fields/location/actions/history

 

Location Reporting API Example Request Body

Retrieve the most recent location value

POST /api/cc/v1/devices/fields/location/actions/history HTTP/1.1

curl -X POST \
https://thingspace.verizon.com/api/cc/v1/devices/fields/location/actions/history \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Bearer 5ab8627992ad3058f2e625b612f7389b' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 136' \
-H 'Content-Type: application/json' \
-H 'Host: thingspace.verizon.com' \
-H 'Postman-Token: 28cb7365-34cc-421c-b17b-0317b2e40f22,2dad15cd-d16d-4f18-bbd4-1a851e017cb2' \
-H 'User-Agent: PostmanRuntime/7.16.3' \
-H 'VZ-M2M-Token: 92995d93-e97a-4955-816d-694edeb3d7a4' \
-H 'cache-control: no-cache' \
-d '{
"accountidentifier": {"billingaccountid": "0642080214-00001"},
"resourceidentifier": {"imei": 864508030155920},
"$limitnumber": 1
}'  

Location Reporting API Example Success Responses ##

The Location reporting API can have two types of success responses as listed below, with examples to follow.

  • API response containing precise location based on GPS/GNSS
  • API response containing coarse location based on CellId

Precise Location Response to API based on GPS/GNSS

{  
       "action":"update",
       "createdon":"2019-05-17T22:40:01Z",
       "deviceid":"24d1eb09-fe77-6f95-f2e8-1fca8e2c50ce",
       "fields":{  
          "location":{  
             "accuracy":"9.0",
             "latitude":"32.8977737",
             "longitude":"-117.2027053",
             "type":"gps"
          }
       },
       "id":"e5c1d620-879a-6a00-e7ad-b7c4b5e7905d",
       "kind":"ts.event",
       "lastupdated":"2019-05-17T22:40:48.343974582Z",
       "state":"update",
       "transactionid":"864508030136201-OnBoard-7cbae151-089e-498e-99a7-632b3f7e664d",
       "version":"1.0",
       "versionid":"d0e39483-78f4-11e9-a6b5-02420a491c0c"
   }

Coarse Location Response to API based on CellId

{  
    "action":"update",
    "createdon":"2019-05-17T21:40:01Z",
    "deviceid":"24d1eb09-fe77-6f95-f2e8-1fca8e2c50ce",
    "fields":{  
       "location":{  
          "altitude":"76.69",
          "latitude":"32.905369",
          "longitude":"-117.192574",
          "radius":"1598.64",
          "type":"cellid"
       }
    },
    "id":"e591ee05-bd36-6b0c-fc74-4bff20b2da1d",
    "kind":"ts.event",
    "lastupdated":"2019-05-17T21:41:12.9Z",
    "state":"update",
    "transactionid":"864508030136201-OnBoard-cbe9148f-c980-4b18-bb76-e626a031c2a0",
    "version":"1.0",
    "versionid":"7dc23eeb-78ec-11e9-b733-02420a581e0e"
 }