The Core APIs facilitate the creation, configuration, and management of WiFi Motion networks via RESTful APIs. It offers interfaces for accessing topologies, events, motion data, and more.
Cognitive Systems App Core API
Device
A wireless client refers to any device that connects to a network using WiFi technology. For optimal performance with WiFi Sensing, stationary devices such as voice assistants (like Amazon Echo or Google Nest), smart plugs, smart displays, and powered wireless speakers are ideal choices. Wireless clients that are mobile can move around and generally have aggressive sleep modes, less reliable Channel State Information (CSI) data, and are not able to be used to help identify localization, all of which can impact the WiFi Motion performance.
Guardian
Guardian is the name of the application that runs on a device, such as an Access Point, WiFi Extender, or IoT device, within a WiFi Network. It's primary functions are to store configuration settings, communicate with WiFi devices within a network, and communicate with the WiFi Motion infrastructure.
The RRULE string which can be generated here: https://jakubroztocil.github.io/rrule/
Note that new lines must be explicitly escaped with \n. Note that providing the RRULE string without the RRULE will result in a yearly alert. For a single occurrence, COUNT=1 must be provided
Example: DTSTART;TZID=America/New_York:20211201T163000\nRRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=1;WKST=MO
Motion monitor object. monitor_mode Specifies the type of monitoring.
NONE: Ignore motion and triggers actions at specified time.
SIMPLE: Checks period between alert trigger and duration_minutes.
INACTIVITY: checks for inactivity in the given period. inactive_minutes specifies the length of the inactivity. repeat_monitoring specifies if the alert should continue after inactivity was detected
The length of time in minutes of the monitored duration. The cloud will determine the start time per the timezone in the rrule field by subtracting this from the targeted time of the monitor completion (in which the result is sent).
If the monitor_mode is "INACTIVITY", this boolean determines if the alert should continue monitoring if inactivity is detected. Defaults to true
The contents of this object are decided by the client and will not persist if the alert is deleted.
Any string that can be used for analytics tracing. Defaults to "" if the field is not included.
Actions to perform when no motion is detected
Actions to perform when there is no record of past motion on the network
- Mock serverhttps://docs.cognitivesystems.com/_mock/assets/specs/api/core/universal-alert
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.cognitivesystems.com/_mock/assets/specs/api/core/universal-alert?network_id=0' \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"enabled": true,
"alert_name": "",
"rrule": "",
"monitor": {
"monitor_mode": "NONE",
"duration_minutes": 0,
"inactive_minutes": 0,
"repeat_monitoring": true,
"stop_event_filter": {}
},
"meta": {},
"analytics_tag": "",
"no_motion_actions": [
{
"action": "string",
"user_ids": [
0
],
"payload": {}
}
],
"motion_actions": [
{
"action": "string",
"user_ids": [
0
],
"payload": {}
}
],
"unknown_actions": [
{
"action": "string",
"user_ids": [
0
],
"payload": {}
}
],
"error_actions": [
{
"action": "string",
"user_ids": [
0
],
"payload": {}
}
]
}'201 - Created
{ "uuid": "Unique alert identifier", "enabled": true, "target": "2021-12-13T16:00:00.000+00:00", "timezone": "America/New_York", "alert_name": "client decided label", "rrule": "DTSTART;TZID=America/New_York:20211201T163000\nRRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=1;WKST=MO", "monitor": { "monitor_mode": "INACTIVITY", "duration_minutes": 10, "inactive_minutes": 2, "repeat_monitoring": true }, "meta": { "anything": "client controlled writable space" }, "analytics_tag": "caregiver_alert_trace", "no_motion_actions": [ { … } ], "motion_actions": [ { … } ], "unknown_actions": [], "error_actions": [], "id": 2255 }
Request
Returns an array of all alerts associated with the network, but from the view of the job queue, including all the internal state of the job.
The data field of this response contains the client facing alert alert model. This endpoint is to assist with seeing the internals of the job queue.
- Mock serverhttps://docs.cognitivesystems.com/_mock/assets/specs/api/core/universal-alert/status
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.cognitivesystems.com/_mock/assets/specs/api/core/universal-alert/status?network_id=0' \
-H 'Authorization: YOUR_API_KEY_HERE'200 - OK
{ "alerts": [ { … } ] }
- Mock serverhttps://docs.cognitivesystems.com/_mock/assets/specs/api/core/universal-alert/{uuid}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.cognitivesystems.com/_mock/assets/specs/api/core/universal-alert/{uuid}?network_id=0' \
-H 'Authorization: YOUR_API_KEY_HERE'200 OK
{ "uuid": "Unique alert identifier", "enabled": true, "target": "2021-12-13T16:00:00.000+00:00", "timezone": "America/New_York", "alert_name": "client decided label", "rrule": "DTSTART;TZID=America/New_York:20211201T163000\nRRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=1;WKST=MO", "monitor": { "monitor_mode": "INACTIVITY", "duration_minutes": 10, "inactive_minutes": 2, "repeat_monitoring": true }, "meta": { "anything": "client controlled writable space" }, "analytics_tag": "caregiver_alert_trace", "no_motion_actions": [ { … } ], "motion_actions": [ { … } ], "unknown_actions": [], "error_actions": [], "id": 2255 }
Generic
A webhook is an automated message sent from one app to another when a specific event occurs, like a payment or a code commit. It works by sending an HTTP request containing data (a "payload") to a unique URL provided by the receiving application. This allows for real-time data sharing and communication between applications without constant polling.