Download OpenAPI specification:Download
PureLife Cloud Webhooks
Webhook API description for communication between PureLife Cloud service and another system, for machine processing.
There are different methods supported for authentication.
Each method is based on a token, which is automatically generated by the PureLife cloud for each created webhook.
The token is based on a z-base-32
encoded UUID-v4
.
For JWT, always the algorithm HS256
is used with the token as the key.
For each webhook an optional Secret-Key can be defined.
If such a key has been provided, the webhook payload is signed with the key via HMAC-SHA256.
The signature is encoded in hexadecimal and sent with a sha256=
prefix as X-Purelife-Cloud-Signature
header.
Sender:
X-Purelife-Cloud-Signature: headerKey
Receiver:
headerHash == payloadHash
More information can be found in the PureLife Cloud documentation at Integration.
When creating a webhook, you can select the format in which the webhook will be sent. The format defines the content and structure of the data.
Currently three formats are supported:
PureSec
- Contains a lot of data. Can be used for bot as well as customer webhooks. Supports all events.Custom 1
- A small webhook with selected data. Can only be used for bot webhooks.Raw sensor data
- Transmits the received sensor data directly. Structure and contents change frequently. Difficult further processing.Webhook, which is sent by the PureLife Cloud when a new event occurs.
Data object representing the state detected by a sensor. If the webhook was sent because of a rule, the rule is part of the request.
required | object Information about the PureLife Cloud sending the webhook. |
required | object Information about the webhook |
required | object Event because of which the webhook was created. |
required | object Data of the sensor that sent the event. |
required | object or null Data of the customer to which the sensor belongs. If the sensor does not belong to any customer, the value is |
required | object Rule which triggered the webhook |
{- "webhook": {
- "id": "3c753228-c570-4ef7-872a-0c19bb7034bd",
- "name": "My awesome webhook",
- "isCustomerHook": false
}, - "event": {
- "id": 31520015,
- "createDate": 1669132872684,
- "type": "presence",
- "action": "empty_room",
- "normalizedCoordinates": [
- {
- "x": 1,
- "y": 1,
- "z": 1
}
], - "raw": { }
}, - "sensor": {
- "id": "id_MzA6QUU6QTQ6RTM6ODQ6NUM",
- "name": "Sensor kitchen",
- "groupId": 28
}, - "customer": {
- "id": 15,
- "name": "PureSec GmbH",
- "location": "Idstein"
}, - "rule": {
- "id": 1023,
- "createDate": 1669132872684,
- "name": "Webhook by fall",
- "title": "Attention John,",
- "message": "Your sensor in the kitchen has detected a fall.",
- "groupId": 28,
- "situation": "fall_detected",
- "situationDescription": "Vielleicht ein Sturz erkannt",
- "hasRegion": true,
- "regionIndex": 0,
- "regionName": "At the door"
}
}
Webhook, which is sent by the PureLife Cloud when a new event occurs.
Data object representing the state detected by a sensor.
sensorId required | string = 26 characters Unique ID of the sensor (device ID). Always has the prefix |
sensorName required | string [ 1 .. 128 ] characters Name of the sensor in PureLife Cloud system. |
location | string or null [ 1 .. 256 ] characters Location of the sensor in the PureLife Cloud system. |
description required | string [ 1 .. 256 ] characters Description of the event in the bot's language. |
title | string non-empty The title of the rule as set in the frontend. Always sent if the event was sent due to a rule. Not sent for customer webhooks. |
message | string non-empty The message of the rule as set in the frontend. Always sent if the event was sent due to a rule. Not sent for customer webhooks. |
createDate required | integer <int64> Time at which the event was created by the sensor. Format: milliseconds since Unix epoch (UTC). |
Array of objects The coordinates of the event scaled to the range [0, 1]. The point (0 | 0 | 0) is the lower-left corner and the value (1 | 1 | 1) the upper-right corner. Is always sent if the event contains coordinates. | |
eventType required | integer <int32> Enum: 1 2 5 6 7 8 10 11 20 21 Type of event. Indicates the state that the sensor has detected.
|
{- "sensorId": "id_MzA6QUU6QTQ6RTM6ODQ6NUM",
- "sensorName": "Anlage #25 - Bad",
- "location": "Idstein",
- "description": "Es wurde wahrscheinlich ein Sturz erkannt",
- "title": "Attention John,",
- "message": "Your sensor in the kitchen has detected a fall.",
- "createDate": 1629968058856,
- "normalizedCoordinates": [
- {
- "x": 1,
- "y": 1,
- "z": 1
}
], - "eventType": 1
}
Webhook, which is sent by the PureLife Cloud when a new event occurs. Events as received from the sensor, without any processing by the PureLife Cloud.
This format is more suitable for experimental purposes and should not be used in a production environment.
Depending on the sensor firmware version, the events do not contain a device ID, and it is up to the webhook creator to create a relationship between the webhook request and the sensor.
Data object representing the state detected by a sensor.
Events as received from the sensor, without any processing by the PureLife Cloud.
The contents of the events may differ depending on the firmware version and settings.
{ }