Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7

Links to documentation

Development: https://devicefinder.dev.api.nwave.io/docs/openapi#/

Production: https://devicefinder.prod.api.nwave.io/docs/openapi#/

Authorization

In order to authorize with this API, you need to provide the authorization token in the X-Auth-Token header. Details on obtaining the token are available here: https://nwaveio.atlassian.net/wiki/spaces/ND/pages/1864761385/REST+Occupancy+API#Authorization

Endpoints

/find_nearby_devices

This endpoint retrieves device information and returns a summary of advertisings for each device.

Advertising summary includes average rssi, number of advertisings and the last advertising time.

Request:

Code Block
languagejson
{
  "advertising_packets": [
    {
      "rssi": 0,
      "msd": "string",
      "time": "2021-09-21T16:57:04.601Z"
    }
  ]
}

rssi: stands for Received Signal Strength Indicator. This is an integer value that is less than 0 that represents signal strength of the received advertising packet.

msd: a hexadecimal string whichstands for Manufacturer Specific Data. This is a string that should start with 5710. To filter out all not-Nwave advertising packets, check that first 2 bytes of msd are in range 0x5710 - 0x571F.

Expand
titleExample of advertising:
Drawio
zoom1
simple0
inComment0
pageId2780004353
custContentId2781708351
lbox1
diagramDisplayNameДиаграмма без названия.drawio
contentVer1
revision1
baseUrlhttps://nwaveio.atlassian.net/wiki
diagramNameДиаграмма без названия.drawio
pCenter0
width1261
links
tbstyle
height246

msd = 5710B6027178DF1F534F6F3C3C047DAB43F9B91326C9585BED13

time: iso8601 timestamp of advertising packet reception.

Response:

Code Block
languagejson
{
    "devices": [
      {
        "device_id": "string",
        "network_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "lat": 0,
        "lon": 0,
        "labels": [
          "string"
        ],
        "custom_id": "string",
        "group_id": 0,
        "group_name": "string",
        "group_custom_id": "string",
        "level_id": 0,
        "level_name": "string",
        "floor_number": 0,
        "zone_id": 0,
        "zone_name": "string",
        "project_id": 0,
        "project_name": "string",
        "damaged": true,
        "occupied": true,
        "status_duration": 0,
        "time": "2021-09-21T16:57:04.604Z",
        "average_rssi": 0,
        "count_of_advertisements": 0
      }
    ]
  }

device_id: hexadecimal string

Expand
titleNullable positional information:

The following fields have null values when the device is not positioned:

network_id: uuid of device’s position

lat: latitude coordinate of the position

lon: longitude coordinate of the position

labels: list of strings representing the position’s labels

custom_id: user-defined id of the position

group_id: integer value representing position’s group id

group_name: user-defined group name

group_custom_id: user-defined group id

level_id: integer value representing position’s level id

level_name: user-defined level name

floor_number: floor number of the position’s level

zone_id: integer value representing position’s zone id

zone_name: user-defined zone name

project_id: integer value representing position’s project id

project_name: user-defined project name

damaged: boolean value representing device’s damaged status

occupied: boolean value representing device’s occupancy status

status_duration: integer representing the duration of the current occupancy status

time: latest advertising timestamp from the device

average_rssi: mean rssi of all the advertising packets from the device

count_of_advertisiments: integer count of advertising packets from the device