Skip to content

Colocations

This resource allows you to get a list of all device that were in contact with specified device. In contact means that distance between devices was less than 2 meters.

Get colocations

GET /v3/novid/colocations - retrieve list of devices that were in contact with specified 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.
trackingId String Use this parameter to specify device's trackingId. TrackingId is equal to lower-case MAC address of a device.
startTime ISO 8601 Timestamp Indicates the starting point of the time range you want to check.
You should use the following format: 2020-08-12T11:40:32+02:00 or 2020-08-12T09:40:32Z for UTC
The time range specified by startTime and endTime can't be longer than 21 days.
endTime ISO 8601 Timestamp Indicates the ending point of the time range you want to check.
You should use the following format: 2020-08-12T11:40:32+02:00 or 2020-08-12T09:40:32Z for UTC
The time range specified by startTime and endTime can't be longer than 21 days.
Sample curl request
$ curl 'https://apps-api.prod.kontakt.io/v3/novid/colocations?page=0&size=2&sort=trackingId&trackingId=aWyhnP&startTime=2020-08-12T06:05:57.057347Z&endTime=2020-08-12T10:05:57.057347Z' -i -X GET \
    -H 'Api-Key: <<Your Api Key>>'
Sample HTTP request
GET /v3/novid/colocations?page=0&size=2&sort=trackingId&trackingId=aWyhnP&startTime=2020-08-12T06:05:57.057347Z&endTime=2020-08-12T10:05:57.057347Z 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: 573

{
  "links" : [ {
    "rel" : "self",
    "href" : "https://apps-api.prod.kontakt.io/v3/novid/colocations?page=0&size=2&sort=trackingId&trackingId=aWyhnP&startTime=2020-08-12T06:05:57.057347Z&endTime=2020-08-12T10:05:57.057347Z"
  } ],
  "content" : [ {
    "trackingId" : "tPUDOm",
    "startTime" : "2020-08-12T06:05:57.057347Z",
    "endTime" : "2020-08-12T10:05:57.057347Z",
    "contacts" : [ {
      "trackingId" : "aWyhnP",
      "durationSec" : 7200.0
    } ]
  } ],
  "page" : {
    "size" : 2,
    "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[].trackingId String The tracking ID of the entity that was within two meters from the device specified in request.
content[].startTime String The starting point of the time range that was checked.
content[].endTIme String The ending point of the time range that was checked.
content[].contacts[].trackingId String The tracking ID of the device specified in the request.
content[].contacts[].durationSec Number How long the devices were in contact with each other. Calculated in seconds.