-
Notifications
You must be signed in to change notification settings - Fork 0
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>
This section consists of location management apis like device location, path and fetching nearby devices.
GET /v1/device/location/<DEVICE_ID> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>
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>
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>
This section consists of session management apis like creating new tracking session for location sharing and freeing up the device by releasing the session.
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"
]
}
DELETE /v1/session/<SESSION_ID> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>
This section consists of places management apis like adding and deactivating places.
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
}
DELETE /v1/place/<PLACE_ID> HTTP/1.1
Host: api.digitreck.com
Authorization: <YOUR_PROJECT_SECRET_KEY>