Rule Webhook JSON
This section provides details on the JSON payload posted when a rule executes. A webhook call is made when a rule is set from Senselytics dashboard with the engagement option set to webhook. Along with posting basic information about the rule which executed, a set of metadata is also posted. Based upon the type of rule set on Context360 Senselytics dashboard this JSON can change.
Note
The deviceId and userId field values are samples and will be substituted with appropriate user details during the post.
Best Time Pre-Sleep Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"motion": "sitting",
"device_orientation" : "face up",
"condition" : "best_time_sleep",
"best_time_satisfied" : true
"lat" : 1.2345678,
"lon" : 1.2345678,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Best Time Post-Wakeup Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"motion": "sitting",
"device_orientation" : "face up",
"condition" : "best_time_wakeup",
"best_time_satisfied" : true
"lat" : 1.2345678,
"lon" : 1.2345678,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Motion Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"motion": "sitting",
"device_orientation" : "face up",
"condition" : "motion",
"lat" : 1.2345678,
"lon" : 1.2345678,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Geo Name Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"condition" : "location",
"category": "Park",
"name" : "Fowler's Park",
"lat" : 1.2345678,
"lon" : 1.2345678,
"horizontal_accuracy" : 20.045,
"distance" : 10.3,
"speed" : 2.43,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Geo Category Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"condition" : "location",
"category": "Park",
"name" : "Fowler's Park",
"condition" : "location",
"lat" : 1.2345678,
"lon" : 1.2345678,
"horizontal_accuracy" : 20.045,
"distance" : 10.3,
"speed" : 2.43,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Geofence Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"type": "drive-by",
"condition" : "geofence",
"fence_id": "abcdef",
"label" : "fence name",
"lat" : 1.2345678,
"lon" : 1.2345678,
"horizontal_accuracy" : 20.045,
"speed" : 2.43,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Geo Beacon Rule Post
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"condition" : "beacon",
"uuid": "abc1248394893def",
"major" : 123,
"minor" : 234,
"rssi" : -75,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Combination Rule Post
Combination Rule
A combination rule is a rule composed of 2 or more of context rules.
{
"version" : "1.0",
"user_id": "[email protected]",
"device_id": "C55B0C8C-912F-4311-AE6C-A60940DF67EE",
"info": [
{
"motion": "sitting",
"device_orientation" : "face up",
"condition" : "motion",
"lat" : 1.2345678,
"lon" : 1.2345678,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
},
{
"type": "walk-in",
"condition" : "geofence",
"fence_id": "wxfyed",
"label" : "fence 2",
"lat" : 1.2345678,
"lon" : 1.2345678,
"horizontal_accuracy" : 20.045,
"speed" : 2.43,
"start": 9387497861,
"ongoing": 9387497898,
"end": 9387497898,
}
],
"rule_id": 1234564,
"payload": {}
}
Updated over 7 years ago