StaySafe 4 Lone Worker Integration
StaySafe 4 is a UK based lone worker safety app and monitoring platform. StaySafe 4 integrates with Patriot via the LogSignal endpoint of the Patriot JSON API (v3), allowing StaySafe Hub to post lone worker session and alert events directly into Patriot in real-time. No dedicated Patriot receiver task is required for this integration.
Prerequisites
- The Patriot JSON API configured with a LogSignal-enabled Security Group and User. See the JSON API Setup Tutorial.
- A StaySafe Hub account with permission to configure organisation/team integrations and edit User Custom Attributes.
- Mapping module registered, or Lite Mapping, if live GPS tracking of StaySafe users is required.
How the Integration Works
StaySafe 4 can be configured on a per organisation or per team basis to POST a payload to a Patriot LogSignal URL. A new request contains one event and is sent in real-time each time an event is triggered on a user's device.
Example payload:
{
"clientNo": "3176BASE99",
"notes": "Session start note",
"rawData": "Event timestamp 2020-06-03T12:39:20Z",
"typeNo": 1,
"longitude": -0.126416,
"latitude": 51.503186,
"media": "url:https://hub.staysafeapp.net/map/session/61b2b584-4c08-412f-8910-b476ca886c7e"
}
| Field | Description |
|---|---|
clientNo | The Patriot Client No. the event should be logged against. See Linking StaySafe Users to Patriot Clients below. |
notes | Additional notes logged with the signal. Not seen by operators. |
rawData | Additional raw event information, visible to operators in the expanded signal view. |
typeNo | The Patriot event type number for the StaySafe event being reported. See Event Mapping below. |
longitude / latitude | GPS location of the StaySafe user at the time of the event, if available. |
media | A link to the live StaySafe Hub map/session for the event, prefixed with url:. |
See the JSON API Setup Tutorial for a full description of every field supported by the Patriot JSON API.
Linking StaySafe Users to Patriot Clients
StaySafe device users are linked to Patriot clients via the Patriot Client No. This must be set against each user in StaySafe Hub, in the Custom Attributes section of their user profile.
See StaySafe's Response Partner Identification (Australia) help article for instructions on setting this Custom Attribute in StaySafe Hub.
Event Mapping
StaySafe events are mapped to Patriot event types below. It is the Patriot typeNo which is passed across via the API.
| Name | Patriot typeNo | Description |
|---|---|---|
| Session Start | 1 | Create a new session |
| Session Extend | 2 | Extend an active session |
| Session End | 3 | End an active session |
| Position Update | 4 | Update location information |
| Session Expired Alert | 5 | A session expired |
| Panic Alert | 6 | A panic alert is triggered |
| Duress Alert | 7 | A duress alert is triggered |
| Battery Alert | 8 | A low battery alert is triggered |
| Non-Movement Alert | 9 | A non-movement alert is triggered |
| Missed Session Check-In | 10 | A session check-in expired |
| Session Check-In | 11 | A session check-in is triggered |
| Fall Detected | 12 | A fall detected alert is triggered |
| Start Driving | 13 | Start driving during a session |
| Stop Driving | 14 | Stop driving during a session |
| Driving Expired | 15 | Expected driving duration expired |
JSON API Setup
Set up a JSON API Security Group and User for StaySafe by following the JSON API Setup Tutorial, ensuring the "Log Signal" option is enabled on the Security Group.
Provide StaySafe with the LogSignal URL and the login details of the User you create, so they can configure the integration in StaySafe Hub.
Patriot Client Setup
A Patriot client for StaySafe is added in the normal way from the Add New Client dialog in the Clients menu. The Client No. must match the Patriot Client No. entered against the user in StaySafe Hub (see Linking StaySafe Users to Patriot Clients above).
Events
Clients need to be set up with a StaySafe Event Type Template on the Event Types tab, using the Event Mapping above. A copy of the StaySafe Event Type Template, ready for Patriot import, is available from Receivers & Format Templates.
Mapping
If live tracking of StaySafe users is required, activate the "Mobile Client" check box on the Mapping tab. Please refer to Patriot's Mapping module documentation for more information. If you do not have the Mapping module registered, then you should refer to Lite Mapping.