WiFi Motion Core APIs (v3-x-x)

The WiFi Motion Core Cloud APIs facilitate the creation, configuration, and management of WiFi Motion networks via RESTful APIs. Additionally, it offers interfaces for accessing topologies, events, and motion data. This documentation outlines the endpoints for engaging with the WiFi Motion cloud and includes specifications for the following APIs:

Network Settings

Motion History

The motion history APIs provide various historical motion metrics.

Live Motion

The live motion API opens a web socket and triggers the network to emit recorded motion at a 500ms interval.

Events

The events APIs allow you to retrieve, create or tag events emitted by the network.

Network Status

High-level APIs for retrieving the network's topology, last status message, or to view or modify the network's metadata.

Location Data

The location data APIs expose localized motion data. Localization happens on a per mac, or custom location name base.

Find

A set of APIs to find a network in the WiFi Motion Cloud. Individual, or groups of networks can be queried by their primary identifiers or by MAC.

Insights (advanced)

APIs of the internal Home Insights Microservice. Used for motion-based activity and sleep insights.

Config (advanced)

Fine-grained network configuration. These APIs give full access to the underlying motion detection controls, but have no safeguards to prevent unwanted side effects. For friendlier configuration management, see the Network Settings APIs.

Node (advanced)

Interface to manage the access point or mesh nodes of a network. Provides APIs to find, delete or alter the configuration of nodes.

Gatekeeper (advanced)

Endpoint used by WiFi Motion agent for the initial cloud connection. This API returns credentials for connecting to the MQTT broker and stores the initial network configuration. We don't recommend using this API directly.

Management (advanced)

Execute commands directly on the network's access point, or on a mesh node. We recommend using the NOC Management Page for these actions.

Debug (advanced)

Debug endpoints, for internal use only.

Application Settings (advanced)

The application settings API allows users to create, update, delete, and retrieve configurations based on network ID.

Download OpenAPI description
Languages
Servers
Mock server

https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/

Network Settings

Operations

Motion History

Operations

Live Motion

Operations

Events

Operations

Network Status

Operations

Network Meta

Operations

Location Data

Operations

Find

Operations

Config

Operations

Node

Operations

Gatekeeper

Operations

Management

Operations

Create a batch

Request

A batch is a group of related management commands that can be monitored using a single WebSocket.

curl -i -X POST \
  https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/manage/batch

Responses

OK.

Bodyapplication/json
batch_idinteger

Newly created batch_id

Response
application/json
{ "batch_id": 0 }

Queue management command

Request

If executeNow is true, default state will be either 002 (waiting for online) or 011 (sent command one time).

If trigger_id is null, default state will be 000 (pending)

If trigger_id is not null, default state will be 001 (waiting for trigger)

Query
createBatchboolean

If true, a new batch will be created for this action.

Default false
Bodyapplication/jsonrequired
network_idinteger

Target node's network_id

created_atnumber

Timestamp the action was created at

updated_atnumber

Timestamp the action was last updated

trigger_idinteger or nullrequired

If not null, the execution of this action will be delayed until this trigger action has completed successfully (status=2xx).

If the trigger action fails (status=4xx), this action will fail with the same status.

payloadobjectrequired
payload.​property name*stringadditional property
stateinteger

000 - Pending start

001 - Waiting for action with trigger_id

002 - Waiting for device to come online

01x - Command was attempted "x" times

100 - Device acknowledged, action started

1xx - command_id specific progress codes

200 - Completed (Success)

4xx - Completed (Failed)

node_idintegerrequired

Target node ID

batch_idinteger or null

Optional batch group identifier for this action. If null then websocket-based monitoring of this action will not be possible.

responseobject
idinteger

Auto-generated action ID

command_idintegerrequired

0 - system_exec

1 - factory_reset

2 - firmware_update

3 - reboot

curl -i -X POST \
  'https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/manage/create?createBatch=false' \
  -H 'Content-Type: application/json' \
  -d '{
    "network_id": 0,
    "created_at": 0,
    "updated_at": 0,
    "trigger_id": 0,
    "payload": {
      "property1": "string",
      "property2": "string"
    },
    "state": 0,
    "node_id": 0,
    "batch_id": 0,
    "response": {
      "property1": "string",
      "property2": "string"
    },
    "id": 0,
    "command_id": 0
  }'

Responses

OK.

Bodyapplication/json
network_idinteger

Target node's network_id

created_atnumber

Timestamp the action was created at

updated_atnumber

Timestamp the action was last updated

trigger_idinteger or nullrequired

If not null, the execution of this action will be delayed until this trigger action has completed successfully (status=2xx).

If the trigger action fails (status=4xx), this action will fail with the same status.

payloadobjectrequired
payload.​property name*stringadditional property
stateinteger

000 - Pending start

001 - Waiting for action with trigger_id

002 - Waiting for device to come online

01x - Command was attempted "x" times

100 - Device acknowledged, action started

1xx - command_id specific progress codes

200 - Completed (Success)

4xx - Completed (Failed)

node_idintegerrequired

Target node ID

batch_idinteger or null

Optional batch group identifier for this action. If null then websocket-based monitoring of this action will not be possible.

responseobject
idinteger

Auto-generated action ID

command_idintegerrequired

0 - system_exec

1 - factory_reset

2 - firmware_update

3 - reboot

Response
application/json
{ "network_id": 0, "created_at": 0, "updated_at": 0, "trigger_id": 0, "payload": { "property1": "string", "property2": "string" }, "state": 0, "node_id": 0, "batch_id": 0, "response": { "property1": "string", "property2": "string" }, "id": 0, "command_id": 0 }

Monitor a batch of actions (WebSocket)

Request

This websocket will produce a stream of updates as actions with the provided batch_id execute.

Query
idnumberrequired

batch_id to be monitored on this WebSocket

curl -i -X GET \
  'https://docs.cognitivesystems.com/_mock/assets/specs/mns/v3-x-x/manage/monitor?id=0'

Responses

WebSocket of ManageAction updates

Debug

Operations

Insights

Operations

Insights v2

Operations

Universal Alerting

Operations

Application Settings

Operations