Notifications are generated based upon various actions, and are represented as Events that get written to predefined Streams. When a notification is generated, two notification Events are created. A redacted notification gets written to the redacted notification location, and the unredacted notification gets written to the unredacted notification location. Redaction is performed because a notification might contain sensitive information that a user without permissions shouldn't be able to view. All users have access to the summary notifications stream; only users with the permissions for the object that generated the notification are able to view the unredacted notification.
Redacted notifications are written to the path /my_company/:summary-inbox
. This Stream contains notifications for all objects and stores only the most recent action for each particular object.
Unredacted notifications for objects other than devices are written to the path /my_company/:inbox/<object_type>
, where valid object types are blueprints
, cloud-actions
, cloud-connectors
, devices
, external
, files
, groups
, local-actions
, mqtt
, shares
, streams
, tasks
, and tokens
.
Unredacted notifications for devices are written to /my_company/devices/<device_name>/:inbox
.
Unredacted Notifications
GET https://octave-api.sierrawireless.io/v5.0/<company_name>/notifications/<object_type>/<object_id>
A user that has permission to the Stream /my_company/:inbox
would be able to see all notifications for all objects. By default, only users that have Admin Group access will be able to read from this path. Update notifications provide a diff of fields that have changed. This diff could contain potentially sensitive information, hence why access to unredacted notifications is restricted by permissions.
Users who do not have access to this path can view notifications for which they are permissioned by using a special REST API endpoint:
Request
curl "https://octave-api.sierrawireless.io/v5.0/my_company/notifications/device/d5b291fc6ff127c21fdce280b" \
-H 'x-auth-user: <user>' \
-H 'x-auth-token: <token>
Response
{
"head": {
"status": 200,
"ok": true,
"messages": [],
"errors": [],
"references": {}
},
"body": [
{
"id": "e5b730c9b83ee68665795b5a2",
"streamId": "s5b291fc6ff127c21fdce281b",
"creationDate": 1534266523583,
"generatedDate": 1534266523583,
"path": "/my_company/devices/my_device/:inbox",
"version": 0,
"elems": {
"sourceId": "d5b291fc6ff127c21fdce280b",
"actor": {
"name": "alice",
"id": "5b2903f6ff127c1f9d80c601"
},
"kind": "NOTIFICATION",
"action": "UPDATE",
"details": {
"lastEditDate": {
"before": 1534266523580,
"after": 1534266506338
},
"state": {
"before": {
"/deviceServices/cellular/signal/enable": true,
"/redSensor/gyro/enable": true,
"/redSensor/accel/enable": true,
"/deviceServices/counter/enable": true,
"/redSensor/light/period": 10,
"/cloudInterface/store_forward/period": 600,
"/redSensor/gyro/period": 200,
"/deviceServices/cellular/signal/period": 10,
"/cloudInterface/status_line/enable": false,
"/redSensor/accel/period": 0.5,
"/deviceServices/counter/period": 0.2,
"/cloudInterface/developer_mode/enable": false,
"/util/counter/period": 0.2
},
"after": {
"/deviceServices/cellular/signal/enable": true,
"/deviceServices/cellular/signal/period": 10,
"/redSensor/gyro/enable": true,
"/redSensor/accel/enable": true,
"/cloudInterface/status_line/enable": false,
"/redSensor/accel/period": 0.5,
"/deviceServices/counter/enable": true,
"/deviceServices/counter/period": 0.2,
"/redSensor/light/period": 10,
"/cloudInterface/developer_mode/enable": false,
"/redSensor/gyro/period": 200,
"/util/counter/period": 0.2
}
}
},
"type": "device"
}
}
]
}
Redacted Notifications
Below is an example redacted notification. Potentially sensitive information is unavailable. The redacted notification contains a reference to the unredacted notification (the Stream in which it is located and its Event object ID).
{
"id" : "e000000009e2d492e73356234",
"streamId" : "s5b4ce3c79e182f53e4f52e02",
"creationDate" : 1531765704081,
"lastEditDate" : 1531765705135,
"generatedDate" : 1531765705133,
"path" : "/my_company/:inbox",
"version" : 0,
"hash" : "s5b4ce3c89e182f53e4f52e39",
"elems" : {
"sourceId" : "s5b4ce3c89e182f53e4f52e39",
"actor" : {
"name" : "system",
"id" : "i000000000000000000000001"
},
"kind" : "NOTIFICATION",
"action" : "UPDATE",
"type" : "device",
"full" : {
"eventId" : "e5b859992e23a21558f31ab7b",
"streamId" : "s5b3ab093665c545444523500"
}
}
}