Skip to content

Positions

This resource allows you to get the position of a device, for example, the x, y coordinates, and the floor where the device is located.

Get positions

GET /v2/positions - retrieve information about the last position of a device.

Query parameters
Parameter Type Description
page Number The page you want to retrieve. The default value is 0.
size Number The size of the page you want to retrieve. The default value is 20.
sort Text How items should be sorted. Sorting for each property can be configured separately.
The possible values are: asc, desc. Default value is asc
Use the following format: property,sorting-order
Example: ?sort=lastname,desc.
floorId Number Use the parameter to filter the results by ID of the floor.
You can get the value from the /v2/locations endpoint.
locationId Number Use the parameter to filter the results by ID of the location.
You can get the value from the /v2/locations endpoint.
lost Boolean Use the parameter to filter the results by the devices that are out of range.
When set to true, endpoint will only return positions of the devices that are no longer in range.
When set to false, endpoint will only return positions of the devices that are in range.
Default value: Not set.
Sample curl request
$ curl 'https://apps-api.prod.kontakt.io/v2/positions?page=0&size=20&sort=floorId,desc&floorId=515162&locationId=3121350&lost=true' -i -X GET \
    -H 'Api-Key: <<Your Api Key>>'
Sample HTTP request
GET /v2/positions?page=0&size=20&sort=floorId,desc&floorId=515162&locationId=3121350&lost=true HTTP/1.1
Host: apps-api.prod.kontakt.io
Api-Key: <<Your Api Key>>
Sample response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1121

{
  "links" : [ {
    "rel" : "self",
    "href" : "https://apps-api.kontakt.io/v2/positions?page=0&sort=floorId,desc&floorId=515162&locationId=3121350&lost=true"
  } ],
  "content" : [ {
    "companyId" : "test1234test",
    "locationId" : 3121350,
    "floorId" : 515162,
    "trackingId" : "ksrQhA",
    "lastUpdate" : "2020-08-10T09:44:32.647Z",
    "x" : 60.47874120059606,
    "y" : 28.559163719368684,
    "z" : 83.44027352283288,
    "xe" : 77.13338387941302,
    "ye" : 50.28691004271084,
    "ze" : 8.171910942638217,
    "origin" : "LOCATION_ENGINE",
    "lost" : true,
  } ],
  "page" : {
    "size" : 20,
    "totalElements" : 1,
    "totalPages" : 1,
    "number" : 0
  }
}
Response fields
Field Type Description
links Array Resource links.
links[].rel String The role of the link.
Depending on the pagination configuration, rel='self' is always present. Other possible values are: first,next,last.
links[].href String The url for the links[].rel parameter.
page Object The metadata of the page.
page.size Number The size of the current page.
page.totalElements Number The number of elements on all pages.
page.totalPages Number The number of all pages.
page.number Number The number of the current page.
content[] Array The content of the page.
content[].companyId String The ID of the user’s company. You can only view positions with your company ID.
content[].locationId Number The ID of the location.
content[].floorId Number The ID of the floor.
content[].zoneId Number The ID of the zone.
content[].trackingId String The tracking ID of the device. Most often it is lowercase MAC address of a device.
content[].lastUpdate String The time of last position change.
content[].x Number The x-axis value of the device coordinates. Value in meters.
content[].y Number The y-axis value of the device coordinates. Value in meters.
content[].z Number The z-axis value of the device coordinates. Value in meters.
content[].xe Number The error in the x-axis value. Calculated in meters.
content[].ye Number The error in the y-axis value. Calculated in meters.
content[].ze Number The error in the z-axis value. Calculated in meters.
content[].origin String The origin of the position.
content[].lost Boolean Flag showing, whether the device is currently out of range.