Cognitive Systems WiFi Motion App-Cloud API (v1-5-x)

App Cloud APIs are used by mobile applications.

Download OpenAPI description
Languages
Servers
Mock server

https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/

https://docs.cognitivesystems.com/api/v1/

Overview

Operations

Out of Box

Operations

Logging In

Operations

Geofencing

Operations

Account Management

Operations

Network Settings

Operations

Sounding v2

Operations

Events, History, and Visualizations

Operations

Household Insights [BETA]

Operations

Zone Priority [BETA]

Operations

Universal Alerting

Operations

Get universal alert

Request

Get a single alert by its uuid.

Path
uuidstring>= 1required
curl -i -X GET \
  'https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/universal-alert/{uuid}' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
idstring

internal unique identifier of the alert

Example: 2255
enabledbooleanrequired

the active status of the alert

Example: true
targetstring

Date string of next notification

Example: "2021-12-13T16:00:00.000+00:00"
timezonestring
Example: "America/New_York"
alert_namestring
Example: "client decided label"
rrulestring
Example: "DTSTART;TZID=America/New_York:20211201T163000\nRRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=1;WKST=MO"
monitorobject
Example: {"monitor_mode":"INACTIVITY","duration_minutes":10,"inactive_minutes":2,"repeat_monitoring":true}
metaobject
Example: {"anything":"client controlled writable space"}
analytics_tagstring
Example: "caregiver_alert_trace"
no_motion_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: [{"action":"fcm_push","user_ids":[5,9],"payload":{"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"no motion","body":"123"},"sound":"Aura_Push_Final.wav","category":"User"}}}}}]
motion_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: [{"action":"fcm_push","payload":{"data":{"click_action":"CustomAlertEvent","title":"NO Motion Ua","body":"No Motion was detected during Now","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"motion","body":"123"},"sound":"Aura_Push_Final.wav","category":"User"}}}}}]
unknown_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: []
error_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: []
uuidstring

Unique id

Example: "Unique alert identifier"
external_idstring

External network id

window_endnumber
window_startinteger

Timestamp showing when monitoring will start

created_atinteger

Alert creation timestamp

next_runany

Timestamp of the next alert trigger. Can be used to monitor the execution of alerts inside the inactivity window.

Response
application/json
{ "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 }

Delete Universal Alert

Request

Deletes an alert by its uuid.

A successful delete will return the entire alert model.

Only the alerts owned by the network can be deleted. And these alerts can be deleted by both member or owner.

Path
uuidstring>= 1required
curl -i -X DELETE \
  'https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/universal-alert/{uuid}' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

201 - Created

Bodyapplication/json
uuidstring
Example: "a93a9c7d-ce5e-4ec7-be6f-8795c68c1930"
enabledboolean
Example: true
alert_namestring
Example: "Outing"
external_idinteger
Example: 14
rrulestring
Example: "DTSTART;TZID=America/New_York:20220318T200000\nRRULE:FREQ=WEEKLY;COUNT=1;INTERVAL=1;WKST=MO"
monitorobject
Example: {"monitor_mode":"SIMPLE","duration_minutes":120}
metaobject
Example: {"alert_type":"OUTING_PRESET"}
analytics_tagstring
Example: "outingsPreset"
no_motion_actionsArray of objects
Example: [{"action":"fcm_push","payload":{"data":{"title":"Friday Bowling","body":"No motion at home 6pm - 8pm","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Friday Bowling","body":"No motion at home from 6pm - 8pm"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}},"user_ids":[]},{"action":"custom_event","payload":{"data":{"title":"Friday Bowling","body":"No motion at home from 6pm - 8pm"}},"user_ids":[]}]
motion_actionsArray of objects
Example: [{"action":"fcm_push","payload":{"data":{"title":"Friday Bowling","body":"Your loved one stayed home","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Friday Bowling","body":"Your loved one stayed home"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}},"user_ids":[]},{"action":"custom_event","payload":{"data":{"title":"Friday Bowling","body":"Your loved one stayed home"}},"user_ids":[]}]
unknown_actionsArray of objects
Example: [{"action":"fcm_push","payload":{"data":{"title":"Friday Bowling","body":"Caregiver Aware could not determine motion in the home","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Friday Bowling","body":"Caregiver Aware could not determine motion in the home"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}},"user_ids":[]},{"action":"custom_event","payload":{"data":{"title":"Friday Bowling","body":"Caregiver Aware could not determine motion in the home"}},"user_ids":[]}]
error_actionsArray of any
Example: []
timezonestring
Example: "America/New_York"
targetstring
Example: "3/18/2022, 8:00:00 PM - America/New_York"
window_endinteger
Example: 1647648000000
idobject(null)
Response
application/json
{ "uuid": "a93a9c7d-ce5e-4ec7-be6f-8795c68c1930", "enabled": true, "alert_name": "Outing", "external_id": 14, "rrule": "DTSTART;TZID=America/New_York:20220318T200000\nRRULE:FREQ=WEEKLY;COUNT=1;INTERVAL=1;WKST=MO", "monitor": { "monitor_mode": "SIMPLE", "duration_minutes": 120 }, "meta": { "alert_type": "OUTING_PRESET" }, "analytics_tag": "outingsPreset", "no_motion_actions": [ { … }, { … } ], "motion_actions": [ { … }, { … } ], "unknown_actions": [ { … }, { … } ], "error_actions": [], "timezone": "America/New_York", "target": "3/18/2022, 8:00:00 PM - America/New_York", "window_end": 1647648000000 }

Update of Single Alert

Request

Update a single alert

If an alert has been switched into an "enabled": false state because the alert has completed every possible recurrence, the mutation must include a new RRULE that has at least one occurrence in the future.

Under the hood, PATCH is a get job, delete job, and create a job.

Note that the following parameters cannot be mutated via the PATCH:

  • external_id
  • uuid
  • options

path parameter can only be the uuid

Path
uuidstring>= 1required
Bodyapplication/jsonrequired
alert_namestring

Default: "" Defaults to an empty string if no value is provided.

Example: "Change"
enabledbooleanrequired
rrulestring

The RRULE string which can be generated here: https://jakubroztocil.github.io/rrule/

Note that new lines must be explicitly escaped with \n. COUNT will always internally converted to 1 since computing every possible alert is not required. The cloud needs only to know when the single next alert is.

Example: DTSTART;TZID=America/New_York:20211201T163000\nRRULE:FREQ=WEEKLY;COUNT=30;INTERVAL=1;WKST=MO

Example: "DTSTART;TZID=Europe/London:20220101T080000\r\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n"
analytics_tagstring

Default: "" Any string that can be used for analytics tracing. Defaults to "" if the field is not included.

Example: "riseAndShinePreset"
monitorobjectrequired

This object defines the conditions and type of the motion monitor.

Example: {"monitor_mode":"SIMPLE","duration_minutes":120}
monitor.​monitor_modestring
Enum"NONE""SIMPLE""INACTIVITY"
Example: "SIMPLE"
monitor.​duration_minutesinteger

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).

Example: 120
monitor.​inactive_minutesinteger

Required if the monitor_mode is "INACTIVITY"

monitor.​repeat_monitoringboolean

If the monitor_mode is "INACTIVITY", this boolean determines if the alert should continue monitoring if inactivity is detected.

monitor.​stop_event_filterobject

Not yet supported - 1/1/2022

The keys of the object will compare to keys of MQTT events as they are from core. All key value pairs placed in this object will be expected on the event from core.

Default {}
metaobject

The contents of this object is fully decided by the client and will not persist anywhere if the alert is deleted.

Example: {"alert_type":"RISE_AND_SHINE_PRESET"}
motion_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: [{"user_ids":[],"action":"fcm_push","payload":{"data":{"title":"Rise and Shine","body":"Your loved one has begun their day","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Rise and Shine","body":"Your loved one has begun their day"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}}},{"user_ids":[],"action":"custom_event","payload":{"data":{"title":"Rise and Shine","body":"Your loved one has begun their day"}}}]
no_motion_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: [{"user_ids":[],"action":"fcm_push","payload":{"data":{"title":"Rise and Shine","body":"Your loved one has not begun their day","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Rise and Shine","body":"Your loved one has not begun their day"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}}},{"action":"custom_event","payload":{"data":{"title":"Rise and Shine","body":"Your loved one has not begun their day"}}}]
unknown_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: [{"user_ids":[],"action":"fcm_push","payload":{"data":{"title":"Rise and Shine","body":"Caregiver Aware could not determine motion in your home","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Rise and Shine","body":"Caregiver Aware could not determine motion in your home"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}}},{"action":"custom_event","payload":{"data":{"title":"Rise and Shine","body":"Caregiver Aware could not determine motion in your home"}}}]
error_actionsArray of objects(Root Type for POST_universal_alerts_actions)
Example: {"type":"Array","Items":{"user_ids":[],"action":"fcm_push","payload":{"data":{"title":"Rise and Shine","body":"Caregiver Aware could not determine motion in your home","click_action":"CustomAlertEvent","sound":"Aura_Push_Final.wav"},"apns":{"headers":{"apns-push-type":"alert","apns-topic":"com.csc.HaloHome"},"payload":{"aps":{"alert":{"title":"Rise and Shine","body":"Caregiver Aware could not determine motion in your home"},"sound":"Aura_Push_Final.wav","category":"CustomAlertEvent"}}}}}}
curl -i -X PATCH \
  'https://docs.cognitivesystems.com/_mock/assets/specs/app-cloud/v1-5-x/universal-alert/{uuid}' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "alert_name": "Change",
    "enabled": false,
    "rrule": "DTSTART;TZID=Europe/London:20220101T080000\r\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU\r\n",
    "analytics_tag": "riseAndShinePreset",
    "monitor": {
      "monitor_mode": "SIMPLE",
      "duration_minutes": 120
    },
    "meta": {
      "alert_type": "RISE_AND_SHINE_PRESET"
    },
    "motion_actions": [
      {
        "user_ids": [],
        "action": "fcm_push",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Your loved one has begun their day",
            "click_action": "CustomAlertEvent",
            "sound": "Aura_Push_Final.wav"
          },
          "apns": {
            "headers": {
              "apns-push-type": "alert",
              "apns-topic": "com.csc.HaloHome"
            },
            "payload": {
              "aps": {
                "alert": {
                  "title": "Rise and Shine",
                  "body": "Your loved one has begun their day"
                },
                "sound": "Aura_Push_Final.wav",
                "category": "CustomAlertEvent"
              }
            }
          }
        }
      },
      {
        "user_ids": [],
        "action": "custom_event",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Your loved one has begun their day"
          }
        }
      }
    ],
    "no_motion_actions": [
      {
        "user_ids": [],
        "action": "fcm_push",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Your loved one has not begun their day",
            "click_action": "CustomAlertEvent",
            "sound": "Aura_Push_Final.wav"
          },
          "apns": {
            "headers": {
              "apns-push-type": "alert",
              "apns-topic": "com.csc.HaloHome"
            },
            "payload": {
              "aps": {
                "alert": {
                  "title": "Rise and Shine",
                  "body": "Your loved one has not begun their day"
                },
                "sound": "Aura_Push_Final.wav",
                "category": "CustomAlertEvent"
              }
            }
          }
        }
      },
      {
        "action": "custom_event",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Your loved one has not begun their day"
          }
        }
      }
    ],
    "unknown_actions": [
      {
        "user_ids": [],
        "action": "fcm_push",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Caregiver Aware could not determine motion in your home",
            "click_action": "CustomAlertEvent",
            "sound": "Aura_Push_Final.wav"
          },
          "apns": {
            "headers": {
              "apns-push-type": "alert",
              "apns-topic": "com.csc.HaloHome"
            },
            "payload": {
              "aps": {
                "alert": {
                  "title": "Rise and Shine",
                  "body": "Caregiver Aware could not determine motion in your home"
                },
                "sound": "Aura_Push_Final.wav",
                "category": "CustomAlertEvent"
              }
            }
          }
        }
      },
      {
        "action": "custom_event",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Caregiver Aware could not determine motion in your home"
          }
        }
      }
    ],
    "error_actions": {
      "type": "Array",
      "Items": {
        "user_ids": [],
        "action": "fcm_push",
        "payload": {
          "data": {
            "title": "Rise and Shine",
            "body": "Caregiver Aware could not determine motion in your home",
            "click_action": "CustomAlertEvent",
            "sound": "Aura_Push_Final.wav"
          },
          "apns": {
            "headers": {
              "apns-push-type": "alert",
              "apns-topic": "com.csc.HaloHome"
            },
            "payload": {
              "aps": {
                "alert": {
                  "title": "Rise and Shine",
                  "body": "Caregiver Aware could not determine motion in your home"
                },
                "sound": "Aura_Push_Final.wav",
                "category": "CustomAlertEvent"
              }
            }
          }
        }
      }
    }
  }'

Responses

201 - Created

Meta

Operations

Administration

Operations