Application Events
The Application Event integration subscription can be configured for your tenacy and provides real-time user events.
Application Events are available for the following integrations:
- Webhook
- Azure Event Hubs
- Azure Service Bus
- AWS Kinesis
- AWS SQS
- Google Pub/Sub
The Event and Payload schema will have a standard structure, however, the payload
attribute schema will vary depending on the resource.
Event Schema
Key | Value |
---|---|
event_type | application_event |
event_data | Application Schema |
Application Schema
Key | Value | Description |
---|---|---|
application_id | Tenant ID | |
user_id | User Id | |
location_id | Location Id | optional |
device_id | Device Id | optional |
fuse_id | Integration Id | optional |
alert_id | Rule Id | optional |
action | Resource Action | Possible values create ,update , delete or login |
resource | Resource | things , users , fuses (integrations) , companies , locations , alerts , reports , corrective-actions-bulk |
timestamp | Event timestamp | |
payload | Resource payload | This attribute varies across actions and resources |
Examples
Location
Update Location
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "1234321-31ba-4c78-b25c-f7491702d70a",
"location_id": 783232443,
"action": "update",
"resource": "locations",
"payload": {
"address": "1234 S Hill Ave",
"city": "DeLand",
"company_id": 662622323232,
"country": "United States",
"external_id": "12",
"industry": "[\"House & Real Estate\"]",
"latitude": 22.9868091,
"longitude": -89.2827882,
"name": "Location Name",
"state": "FL",
"timezone": "America/New_York",
"zip": "32724"
},
"timestamp": 1639022421594
}
}
Create Location
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "7286f306-78f6-4fc0-8ce9-c6ca23733653",
"location_id": 8429,
"action": "create",
"resource": "locations",
"payload": {
"company_id": 9148,
"name": "My New Location",
"address": "3900 W Alameda Ave",
"city": "Burbank",
"state": "CA",
"zip": "91505",
"country": "USA",
"industry": "[\"IoT\"]",
"supported_device": "Default",
"external_id": "7255",
"latitude": 34.1526642,
"longitude": -118.3428161,
"timezone": "America/Los_Angeles"
}
}
}
Delete Location
Location Meta
Create Location Meta
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "7286f306-78f6-4fc0-8ce9-c6ca23733653",
"option_id": 606,
"action": "create",
"resource": "meta-options",
"payload": {
"label": "new label",
"type": "new type",
"data": {
"hello": "world"
}
}
}
}
Update Location Meta
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "7286f306-78f6-4fc0-8ce9-c6ca23733653",
"option_id": 606,
"action": "update",
"resource": "meta-options",
"payload": {
"label": "new new label",
"type": "new new type",
"data": {
"hello": "mars"
}
}
}
}
User
User Create
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": 1234,
"action": "create",
"resource": "users",
"payload": {
"first_name": "magnus",
"last_name": "carlsen",
"email": "baruttuffesu-4312@yopmail.com",
"phone_number": "12341234",
"locale": "en-us",
"client_id": "iotinabox"
}
}
}
User Update
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "6999dd51-517d-4f8f-b1d7-44eb60910f83",
"action": "update",
"resource": "users",
"payload": {
"first_name": "jane",
"last_name": "smith",
"email": "jane@smith.com",
"username": "jane@smith.com",
"phone_number": "12341234",
"locale": "string",
"temperature": {
"unit": "f"
}
}
User Login
{
"event_type": "application-event",
"event_data": {
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "12345664-1234-4c78-b25c-f7491702d70a",
"action": "login",
"resource": "users",
"payload": {
"client_id": "tina-client-id",
"grant_type": "password",
"username": "foobar@example.com"
},
"timestamp": 1639022434782
}
}
}
User Signup
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "12345664-1234-4c78-b25c-f7491702d70a",
"action": "create",
"resource": "users",
"payload": {
"client_id": "tina-client-id",
"email": "foobar@example.com",
"first_name": "Foo",
"last_name": "Bar",
"locale": "en-us",
"phone_number": "+1234565433222"
},
"timestamp": 1639022434782
}
}
User Reset Password
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "ebe87724-9597-44d6-81be-99fc62a18313",
"action": "reset-password",
"resource": "users",
"payload": {
"value": "newPass"
}
}
}
Device
Create Device
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"device_id": 123456,
"action": "create",
"resource": "things",
"payload": {
"name": "my sensor",
"device_id": "2345678",
"sensor_use_id": 2,
"sensor_use": "measure",
"sensor_type": "ruler",
"marker_alert": "off",
"properties": {},
"external_id": "7255"
}
}
}
Update Device
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"device_id": 123456,
"action": "update",
"resource": "things",
"payload": {
"name": "updated name",
"sensor_use_id": 3,
"sensor_use": "camera",
"marker_alert": "off",
"properties": {},
"hardware_id": "123456",
"location_id": 7168,
"company_id": 7853,
"enabled": 0,
"external_id": "6789"
}
}
}
Delete Device
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "12345678-31ba-4c78-b25c-f7491702d70a",
"device_id": "123456987-2b99-11ec-8292-0f9cb2fb7dd6",
"action": "delete",
"resource": "things",
"payload": null,
"timestamp": 1639087262525
}
}
Create Gateway
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"device_id": 12345,
"action": "create",
"resource": "things",
"payload": {
"name": "brand new gateway",
"marker_alert": "off",
"properties": {},
"device_id": "string",
"external_id": "7255"
}
}
}
Companies
Create Company
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "7286f306-78f6-4fc0-8ce9-c6ca23733653",
"company_id": 9157,
"action": "create",
"resource": "companies",
"payload": {
"name": "MyCompany1",
"industry": "Industry1",
"address": "Address3",
"city": "City3",
"state": "State3",
"zip": "Zip3",
"country": "Country3",
"latitude": 0,
"longitude": 0
}
}
}
Update Company
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "7286f306-78f6-4fc0-8ce9-c6ca23733653",
"company_id": 9157,
"action": "update",
"resource": "companies",
"payload": {
"name": "MyCompany2131",
"industry": "Industry1234",
"address": "Address3",
"city": "NewCity",
"state": "NewState3",
"zip": "Zip3",
"country": "Country3",
"latitude": 0,
"longitude": 0
}
}
}
Delete Company
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "7286f306-78f6-4fc0-8ce9-c6ca23733653",
"company_id": 9157,
"action": "delete",
"resource": "companies",
"payload": null
}
}
Rules
Create Rule
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"device_id": "1a7e1448-317e-4a1c-858d-4fbde03a1169",
"action": "create",
"resource": "rules",
"payload": {
"rule_type": "temperature",
"name": "Room temp Alert",
"location_name": "iot on the moon",
"location_address": "549 Moon Clinton Rd, Los Moon, PA 15108, United States",
"enabled": true,
"notifications": [
{
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"message": "",
"date_timezone": "America/New_York",
"method": "email",
"data": {
"locale": "en-us"
},
"fname": "magnus",
"lname": "carlsen",
"locale": "en-us",
"value": "your@email.com"
},
{
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"message": "",
"date_timezone": "America/New_York",
"method": "sms",
"data": {
"locale": "en-us"
},
"fname": "magnus",
"lname": "carlsen",
"locale": "en-us",
"value": "+16612223344"
}
],
"triggers": [
{
"id": "f2b0ed40-7962-11ec-968a-ebc37188ebfc",
"channel": 3,
"unit": "f",
"conditions": [
{
"operator": "gt",
"value": 100
}
],
"triggers_combination": "OR"
},
{
"id": "f2b0ed40-7962-11ec-968a-ebc37188ebfc",
"channel": 3,
"unit": "f",
"conditions": [
{
"operator": "lt",
"value": 32
}
],
"triggers_combination": "OR"
}
],
"delay": {
"time": 600000,
"count": 1
},
"overrides": [
{
"type": "repeat_execution",
"timeout": 300000,
"count": -1,
"starting_at": "2022-01-19T20:08:26.040Z"
}
],
"actions": [],
"trigger_on_condition_exit": false,
"triggers_combination": "OR",
"http_push": [],
"version": "1.0",
"display_text": " ",
"child_name": "Temperature",
"device_name": "Room temp",
"thing_type": 1,
"sensor_use": "Room",
"sensor_type": "Temperature/Humidity"
}
}
}
Update Rule
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"device_id": "c29aa2ff-3d54-48ec-96d9-583459d5fb1a",
"action": "update",
"resource": "rules",
"payload": {
"rule_type": "temperature",
"name": "updated Room temp Alert",
"location_name": "iot on the moon",
"location_address": "549 Moon Clinton Rd, Los Moon, PA 15108, United States",
"enabled": true,
"notifications": [
{
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"message": "",
"date_timezone": "America/New_York",
"method": "email",
"data": {},
"fname": "tom",
"lname": "brady",
"locale": "en-us",
"value": "your@email.com"
},
{
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"message": "",
"date_timezone": "America/New_York",
"method": "sms",
"data": {},
"fname": "tom",
"lname": "brady",
"locale": "en-us",
"value": "+16612227777"
}
],
"triggers": [
{
"id": "f2b0ed40-7962-11ec-968a-ebc37188ebfc",
"channel": 3,
"unit": "f",
"conditions": [
{
"operator": "gt",
"value": 100
}
],
"triggers_combination": "OR"
},
{
"id": "f2b0ed40-7962-11ec-968a-ebc37188ebfc",
"channel": 3,
"unit": "f",
"conditions": [
{
"operator": "lt",
"value": 32
}
],
"triggers_combination": "OR"
}
],
"delay": {
"time": 600000,
"count": 1
},
"overrides": [
{
"type": "repeat_execution",
"timeout": 300000,
"count": -1,
"starting_at": "2022-01-19T20:19:53.707Z"
}
],
"actions": [],
"triggers_combination": "OR",
"version": "1.0",
"child_name": "Temperature",
"device_name": "Room temp",
"thing_type": 1,
"sensor_use": "Room",
"sensor_type": "Temperature/Humidity"
}
}
}
Delete Rule
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"device_id": "c29aa2ff-3d54-48ec-96d9-583459d5fb1a",
"action": "delete",
"resource": "rules",
"payload": {
"rule_type": "temperature",
"name": "updated Room temp Alert",
"location_name": "iot on the moon",
"location_address": "549 Moon Clinton Rd, Los Moon, PA 15108, United States",
"enabled": true,
"notifications": [
{
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"message": "",
"date_timezone": "America/New_York",
"method": "email",
"data": {}
},
{
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"message": "",
"date_timezone": "America/New_York",
"method": "sms",
"data": {}
}
],
"triggers": [
{
"id": "f2b0ed40-7962-11ec-968a-ebc37188ebfc",
"channel": 3,
"unit": "f",
"conditions": [
{
"operator": "gt",
"value": 100
}
]
},
{
"id": "f2b0ed40-7962-11ec-968a-ebc37188ebfc",
"channel": 3,
"unit": "f",
"conditions": [
{
"operator": "lt",
"value": 32
}
]
}
],
"delay": {
"time": 600000,
"count": 1
},
"overrides": [
{
"type": "repeat_execution",
"timeout": 300000,
"count": -1
}
],
"actions": []
}
}
}
Fuses
Create Fuses
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"fuse_id": "75d78bb0-7969-11ec-968a-ebc37188ebfc",
"action": "create",
"resource": "fuses",
"payload": {
"name": "My Fuse",
"auth_status": "PENDING",
"active": 1,
"fields": "company.address,company.city,company.country,company.created_at,company.external_id,company.id,company.industry,company.latitude,company.longitude,company.name,company.state,company.status,company.timezone,company.updated_at,company.user_id,company.zip,device.created_at,device.external_id,device.id,device.sensor_use,device.status,device.thing_name,device.updated_at,device_type.application_id,device_type.category,device_type.codec,device_type.created_at,device_type.data_type,device_type.description,device_type.id,device_type.manufacturer,device_type.model,device_type.name,device_type.parent_constraint,device_type.proxy_handler,device_type.subcategory,device_type.transport_protocol,device_type.updated_at,device_type.version,location.address,location.city,location.company_id,location.country,location.created_at,location.external_id,location.id,location.industry,location.latitude,location.longitude,location.name,location.state,location.status,location.timezone,location.updated_at,location.user_id,location.zip,rule.created_at,rule.id,rule.name,rule.updated_at",
"settings": [],
"event_subscriptions": "alert,uplink,ping",
"device_subscriptions": "*",
"integration_id": "c28495cb-8b66-46f9-bdb4-d6c838162c0b",
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121"
}
}
}
Update Fuse
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"fuse_id": "75d78bb0-7969-11ec-968a-ebc37188ebfc",
"action": "update",
"resource": "fuses",
"payload": {
"name": "updated Fuse",
"auth_status": "PENDING",
"active": 1,
"fields": "company.address,company.city,company.country,company.created_at,company.external_id,company.id,company.industry,company.latitude,company.longitude,company.name,company.state,company.status",
"settings": [],
"event_subscriptions": "alert,uplink,ping",
"device_subscriptions": "*"
}
}
}
Delete Fuse
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"fuse_id": "75d78bb0-7969-11ec-968a-ebc37188ebfc",
"action": "delete",
"resource": "fuses",
"payload": {
"name": "updated Fuse",
"auth_status": "PENDING",
"active": 1,
"fields": "company.address,company.city,company.country,company.created_at,company.external_id,company.id,company.industry,company.latitude,company.longitude,company.name,company.state,company.status",
"settings": [],
"event_subscriptions": "alert,uplink,ping",
"device_subscriptions": "*"
}
}
}
Report
Report Create
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"report_id": 6723,
"action": "create",
"resource": "reports",
"payload": {
"name": "brand new report",
"message": "email results when reviewed",
"locations": [
8341
],
"users": [
"8056c577-2149-45b3-999c-355ec22b8121"
],
"frequency": "week",
"day": 1,
"hour": 16,
"minute": 0,
"timezone": "America/Chicago",
"report_template_id": 3,
"things": [],
"times": [],
"public": 0,
"company_id": 7857
}
}
}
Report Update
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"report_id": 6722,
"action": "update",
"resource": "reports",
"payload": {
"name": "iot on the moon Report",
"message": "updated new message",
"locations": [
8341
],
"users": [
"8056c577-2149-45b3-999c-355ec22b8121"
],
"frequency": "week",
"day": 1,
"hour": 16,
"minute": 0,
"timezone": "America/Chicago",
"report_template_id": 3,
"things": [],
"times": [],
"public": 0
}
}
}
Report Delete
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"report_id": 6723,
"action": "delete",
"resource": "reports",
"payload": {
"name": "brand new report",
"message": "email results when reviewed",
"locations": [
8341
],
"users": [
"8056c577-2149-45b3-999c-355ec22b8121"
],
"frequency": "week",
"day": 1,
"hour": 16,
"minute": 0,
"timezone": "America/Chicago",
"report_template_id": 3,
"things": [],
"times": []
}
}
}
Corrective Actions
Create Action
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"action_id": 7890,
"action": "create",
"resource": "corrective-actions",
"payload": {
"action_text": "new action",
"rule_id": "cc886b9a-5048-4f61-b78a-0f6f77174166",
"notification_id": "123",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"application_id": "iotinabox"
}
}
}
Update Action
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"action_id": 7890,
"action": "update",
"resource": "corrective-actions",
"payload": {
"action_text": "new updated action"
}
}
}
Delete Action
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"action_id": 7890,
"action": "delete",
"resource": "corrective-actions",
"payload": {
"action_text": "new updated action"
}
}
}
Create Note
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"note_id": 8908,
"action": "create",
"resource": "corrective-action-notes",
"payload": {
"note_text": "dually noted",
"rule_id": "cc886b9a-5048-4f61-b78a-0f6f77174166",
"notification_id": "1237890",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"author_id": "8056c577-2149-45b3-999c-355ec22b8121",
"application_id": "iotinabox"
}
}
}
Create Bulk Note
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"action_id": 5676,
"action": "create",
"resource": "corrective-actions-bulk",
"payload": [
{
"action_text": "dually updated noted"
},
{
"action_text": "bulk text in here"
}
]
}
}
Updated Note
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"note_id": 8908,
"action": "update",
"resource": "corrective-action-notes",
"payload": {
"note_text": "dually updated noted"
}
}
}
Delete Note
{
"event_type": "application-event",
"event_data": {
"application_id": "iotinabox",
"user_id": "8056c577-2149-45b3-999c-355ec22b8121",
"location_id": 7213,
"company_id": 7857,
"note_id": 8908,
"action": "delete",
"resource": "corrective-action-notes",
"payload": {
"note_text": "dually updated noted"
}
}
}