Skip to content

REST Apis

Prateek Srivastava edited this page Mar 30, 2018 · 10 revisions

digitreck provides several REST apis for locating device, managing tracking sessions and places.

Base Url

https://api.digitreck.com

Location Management

This section consists of location management apis like device location, path and fetching nearby devices.

Device Location

GET /v1/device/location/<DEVICE_ID> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>

Device Path

GET /v1/device/path/<DEVICE_ID>?from=<START_DATE_IN_MILLIS>&to=<END_DATE_IN_MILLIS> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>

Nearby Devices

GET /v1/device/nearby?tag=<OPTIONAL_TAG>&lat=<LATITUDE>&lng=<LONGITUDE>&count=<OPTIONAL_RESULT_COUNT> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>

Places Management

This section consists of places management apis like adding and deactivating places.

Adding a Place

POST /v1/place HTTP/1.1
Host: api.digitreck.com
Content-Type: application/json
Authorization: <YOUR_PROJECT_SECRET_KEY>

{
    "tag":"<OPTIONAL_TAG>",
    "label":"<UNIQUE_PLACE_LABEL>",
    "lat":12.345,
    "lng":98.765,
    "range":100
}

Deactivating Place

DELETE /v1/place/<PLACE_ID> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>