Skip to content

new Rest api

Prateek Srivastava edited this page Nov 1, 2017 · 3 revisions

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

Production Base Url

http://api.digitreck.com

Sandbox Base Url

http://sandbox-api.digitreck.com

Basic API Request Headers

Content-Type: application/json
Authorization: <YOUR_PROJECT_SECRET_KEY>

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?group=<GROUP_ID>&lat=<LATITUDE>&lng=<LONGITUDE>&count=<RESULT_COUNT> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>

Session Management

This section consists of session management apis like creating new tracking session for location sharing and freeing up the device by releasing the session.

Session Create

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

{
    "devices": [
        "DEVICE_ID_1",
        "DEVICE_ID_2",
        "DEVICE_ID_3"
    ]
}

Session Release

DELETE /v1/session/<SESSION_ID> 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>

{
    "group":"<GROUP_ID>",
    "label":"<UNIQUE_PLACE_LABEL>",
    "lat":12.9145009,
    "lng":77.50123009,
    "range":100
}

Deactivating Place

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