docs/_schemas.md in losant_rest-1.2.0 vs docs/_schemas.md in losant_rest-1.2.1

- old
+ new

@@ -67,10 +67,14 @@ * [Workflow Storage Entries](#workflow-storage-entries) * [Workflow Storage Entry](#workflow-storage-entry) * [Workflow Trigger Filter](#workflow-trigger-filter) * [Workflows](#workflows) * [Github Login](#github-login) +* [Integrations](#integrations) +* [Integrations Patch](#integrations-patch) +* [Integrations Post](#integrations-post) +* [Integrations](#integrations) * [Last Value Data](#last-value-data) * [Last Value Query](#last-value-query) * [Me](#me) * [Me Patch](#me-patch) * [Multi Device Command](#multi-device-command) @@ -349,10 +353,13 @@ "type": "number" }, "flowCount": { "type": "number" }, + "integrationCount": { + "type": "number" + }, "webhookCount": { "type": "number" } } } @@ -433,10 +440,12 @@ "experienceEndpoints.*", "experienceGroup.*", "experienceGroups.*", "experienceUser.*", "experienceUsers.*", + "integration.*", + "integrations.*", "flow.*", "flows.*", "webhook.*", "webhooks.*", "application.delete", @@ -504,12 +513,17 @@ "flow.getStorageEntries", "flow.log", "flow.patch", "flow.pressVirtualButton", "flow.setStorageEntry", - "flows.create", "flows.get", + "flows.post", + "integration.delete", + "integration.get", + "integration.patch", + "integrations.get", + "integrations.post", "webhook.delete", "webhook.get", "webhook.patch", "webhooks.get", "webhooks.post" @@ -1079,10 +1093,13 @@ "type": "number" }, "flowCount": { "type": "number" }, + "integrationCount": { + "type": "number" + }, "webhookCount": { "type": "number" } } } @@ -1214,10 +1231,11 @@ "ExperienceEndpoint", "ExperienceGroup", "ExperienceUser", "Flow", "SolutionUser", + "Integration", "Webhook" ] }, "secondaryTargetName": { "type": "string", @@ -1357,10 +1375,11 @@ "ExperienceEndpoint", "ExperienceGroup", "ExperienceUser", "Flow", "SolutionUser", + "Integration", "Webhook" ] }, "name": { "type": "string", @@ -1517,10 +1536,11 @@ "ExperienceEndpoint", "ExperienceGroup", "ExperienceUser", "Flow", "SolutionUser", + "Integration", "Webhook" ] }, "secondaryTargetName": { "type": "string", @@ -6280,21 +6300,22 @@ }, "type": { "type": "string", "enum": [ "deviceId", + "deviceIdConnect", + "deviceIdDisconnect", "deviceTag", + "deviceTagConnect", + "deviceTagDisconnect", + "endpoint", + "event", "mqttTopic", - "webhook", + "integration", "timer", - "event", "virtualButton", - "endpoint", - "deviceIdConnect", - "deviceIdDisconnect", - "deviceTagConnect", - "deviceTagDisconnect" + "webhook" ] }, "config": { "type": "object" }, @@ -6528,21 +6549,22 @@ }, "type": { "type": "string", "enum": [ "deviceId", + "deviceIdConnect", + "deviceIdDisconnect", "deviceTag", + "deviceTagConnect", + "deviceTagDisconnect", + "endpoint", + "event", "mqttTopic", - "webhook", + "integration", "timer", - "event", "virtualButton", - "endpoint", - "deviceIdConnect", - "deviceIdDisconnect", - "deviceTagConnect", - "deviceTagDisconnect" + "webhook" ] }, "config": { "type": "object" }, @@ -6678,21 +6700,22 @@ }, "type": { "type": "string", "enum": [ "deviceId", + "deviceIdConnect", + "deviceIdDisconnect", "deviceTag", + "deviceTagConnect", + "deviceTagDisconnect", + "endpoint", + "event", "mqttTopic", - "webhook", + "integration", "timer", - "event", "virtualButton", - "endpoint", - "deviceIdConnect", - "deviceIdDisconnect", - "deviceTagConnect", - "deviceTagDisconnect" + "webhook" ] }, "config": { "type": "object" }, @@ -6962,21 +6985,22 @@ }, "type": { "type": "string", "enum": [ "deviceId", + "deviceIdConnect", + "deviceIdDisconnect", "deviceTag", + "deviceTagConnect", + "deviceTagDisconnect", + "endpoint", + "event", "mqttTopic", - "webhook", + "integration", "timer", - "event", "virtualButton", - "endpoint", - "deviceIdConnect", - "deviceIdDisconnect", - "deviceTagConnect", - "deviceTagDisconnect" + "webhook" ] }, "config": { "type": "object" }, @@ -7176,10 +7200,745 @@ } ``` <br/> +## Integrations + +Schema for a single Integrations + +### <a name="integrations-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "integrationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "applicationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "creationDate": { + "type": "string", + "format": "date-time" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "integrationType": { + "type": "string", + "enum": [ + "mqtt", + "googlePubSub" + ] + }, + "enabled": { + "type": "boolean" + }, + "topics": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + } + }, + "googlePubSubConfig": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "keyJson": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "projectId", + "keyJson" + ] + }, + "mqttConfig": { + "type": "object", + "properties": { + "clientId": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "username": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "password": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "clean": { + "type": "boolean" + }, + "port": { + "type": "number", + "minimum": 1, + "maximum": 65535 + }, + "protocol": { + "type": "string", + "enum": [ + "mqtt", + "mqtts", + "ws", + "wss" + ] + }, + "host": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "privateKey": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "certificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "caCertificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "port", + "protocol", + "host" + ] + }, + "status": { + "lastKeepAlive": { + "type": [ + "number" + ] + }, + "nextAttempt": { + "type": [ + "number" + ] + }, + "connectInfo": { + "type": "object", + "properties": { + "ts": { + "type": [ + "number", + "null" + ] + } + } + }, + "disconnectInfo": { + "type": "object", + "properties": { + "ts": { + "type": [ + "number", + "null" + ] + }, + "error": { + "type": "string" + } + } + } + } + } +} +``` +### <a name="integrations-example"></a> Example + +```json +{ + "id": "58ec07f20c747f65243d0d76", + "integrationId": "58ec07f20c747f65243d0d76", + "applicationId": "575ec8687ae143cd83dc4a97", + "creationDate": "2016-06-13T04:00:00.000Z", + "lastUpdated": "2016-06-13T04:00:00.000Z", + "name": "Example Integrations", + "integrationType": "mqtt", + "enabled": true, + "topics": [ + "myTopic" + ], + "mqttConfig": { + "clientId": "exampleClientId", + "username": "exampleUsername", + "password": "examplePassword", + "port": 8883, + "protocol": "mqtts", + "host": "broker.example.com" + }, + "status": { + "lastKeepAlive": 1491863679994, + "connectInfo": { + "ts": 1490629589313 + }, + "disconnectInfo": { + "ts": 1490629587190, + "error": "Keepalive Timeout" + } + } +} +``` + +<br/> + +## Integrations Patch + +Schema for the body of an Integrations modification request + +### <a name="integrations-patch-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "integrationType": { + "type": "string", + "enum": [ + "mqtt", + "googlePubSub" + ] + }, + "enabled": { + "type": "boolean" + }, + "topics": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + } + }, + "googlePubSubConfig": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "keyJson": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "projectId", + "keyJson" + ] + }, + "mqttConfig": { + "type": "object", + "properties": { + "clientId": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "username": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "password": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "clean": { + "type": "boolean" + }, + "port": { + "type": "number", + "minimum": 1, + "maximum": 65535 + }, + "protocol": { + "type": "string", + "enum": [ + "mqtt", + "mqtts", + "ws", + "wss" + ] + }, + "host": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "privateKey": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "certificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "caCertificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "port", + "protocol", + "host" + ] + } + }, + "additionalProperties": false +} +``` +### <a name="integrations-patch-example"></a> Example + +```json +{ + "topics": [ + "differentTopic" + ] +} +``` + +<br/> + +## Integrations Post + +Schema for the body of an Integrations creation request + +### <a name="integrations-post-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "integrationType": { + "type": "string", + "enum": [ + "mqtt", + "googlePubSub" + ] + }, + "enabled": { + "type": "boolean" + }, + "topics": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + } + }, + "googlePubSubConfig": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "keyJson": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "projectId", + "keyJson" + ] + }, + "mqttConfig": { + "type": "object", + "properties": { + "clientId": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "username": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "password": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "clean": { + "type": "boolean" + }, + "port": { + "type": "number", + "minimum": 1, + "maximum": 65535 + }, + "protocol": { + "type": "string", + "enum": [ + "mqtt", + "mqtts", + "ws", + "wss" + ] + }, + "host": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "privateKey": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "certificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "caCertificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "port", + "protocol", + "host" + ] + } + }, + "additionalProperties": false, + "required": [ + "name", + "integrationType" + ] +} +``` +### <a name="integrations-post-example"></a> Example + +```json +{ + "name": "Example Integrations", + "integrationType": "mqtt", + "topics": [ + "myTopic" + ], + "mqttConfig": { + "clientId": "exampleClientId", + "username": "exampleUsername", + "password": "examplePassword", + "port": 8883, + "protocol": "mqtts", + "host": "broker.example.com" + } +} +``` + +<br/> + +## Integrations + +Schema for a collection of Integrations + +### <a name="integrations-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "title": "Integrations", + "description": "Schema for a single Integrations", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "integrationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "applicationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "creationDate": { + "type": "string", + "format": "date-time" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "integrationType": { + "type": "string", + "enum": [ + "mqtt", + "googlePubSub" + ] + }, + "enabled": { + "type": "boolean" + }, + "topics": { + "type": "array", + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + } + }, + "googlePubSubConfig": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "minLength": 1, + "maxLength": 1024 + }, + "keyJson": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "projectId", + "keyJson" + ] + }, + "mqttConfig": { + "type": "object", + "properties": { + "clientId": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "username": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "password": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "clean": { + "type": "boolean" + }, + "port": { + "type": "number", + "minimum": 1, + "maximum": 65535 + }, + "protocol": { + "type": "string", + "enum": [ + "mqtt", + "mqtts", + "ws", + "wss" + ] + }, + "host": { + "type": "string", + "maxLength": 1024, + "minLength": 1 + }, + "privateKey": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "certificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + }, + "caCertificate": { + "type": "string", + "maxLength": 32767, + "minLength": 50 + } + }, + "additionalProperties": false, + "required": [ + "port", + "protocol", + "host" + ] + }, + "status": { + "lastKeepAlive": { + "type": [ + "number" + ] + }, + "nextAttempt": { + "type": [ + "number" + ] + }, + "connectInfo": { + "type": "object", + "properties": { + "ts": { + "type": [ + "number", + "null" + ] + } + } + }, + "disconnectInfo": { + "type": "object", + "properties": { + "ts": { + "type": [ + "number", + "null" + ] + }, + "error": { + "type": "string" + } + } + } + } + } + } + }, + "count": { + "type": "integer" + }, + "totalCount": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "filter": { + "type": "string" + }, + "filterField": { + "type": "string" + }, + "sortField": { + "type": "string" + }, + "sortDirection": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "applicationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + } + } +} +``` +### <a name="integrations-example"></a> Example + +```json +{ + "items": [ + { + "$ref": "#/examples/integrations" + } + ], + "count": 1, + "totalCount": 4, + "perPage": 1, + "page": 0, + "sortField": "name", + "sortDirection": "asc", + "applicationId": "575ec8687ae143cd83dc4a97" +} +``` + +<br/> + ## Last Value Data Schema for the result of a last value query ### <a name="last-value-data-schema"></a> Schema @@ -7361,10 +8120,14 @@ }, "url": { "type": "string", "maxLength": 1024 }, + "tokenCutoff": { + "type": "string", + "format": "date-time" + }, "emailVerified": { "type": "boolean" }, "twoFactorAuthEnabled": { "type": "boolean" @@ -7411,10 +8174,13 @@ "type": "number" }, "flow": { "type": "number" }, + "integration": { + "type": "number" + }, "webhook": { "type": "number" }, "dataTTL": { "type": "number" @@ -7663,13 +8429,24 @@ "patternProperties": { ".*": { "type": "number" } } + }, + "integration": { + "type": "object", + "patternProperties": { + ".*": { + "type": "number" + } + } } } }, + "integrationCount": { + "type": "number" + }, "webhookCount": { "type": "number" } } }, @@ -7760,10 +8537,14 @@ }, "password": { "type": "string", "minLength": 8, "maxLength": 2048 + }, + "tokenCutoff": { + "type": "string", + "format": "date-time" } }, "additionalProperties": false } ``` @@ -7989,10 +8770,13 @@ "type": "number" }, "solution": { "type": "number" }, + "integration": { + "type": "number" + }, "webhook": { "type": "number" }, "dataTTL": { "type": "number" @@ -8133,16 +8917,27 @@ "patternProperties": { ".*": { "type": "number" } } + }, + "integration": { + "type": "object", + "patternProperties": { + ".*": { + "type": "number" + } + } } } }, "solutionCount": { "type": "number" }, + "integrationCount": { + "type": "number" + }, "webhookCount": { "type": "number" } } }, @@ -8720,10 +9515,13 @@ "type": "number" }, "solution": { "type": "number" }, + "integration": { + "type": "number" + }, "webhook": { "type": "number" }, "dataTTL": { "type": "number" @@ -8864,16 +9662,27 @@ "patternProperties": { ".*": { "type": "number" } } + }, + "integration": { + "type": "object", + "patternProperties": { + ".*": { + "type": "number" + } + } } } }, "solutionCount": { "type": "number" }, + "integrationCount": { + "type": "number" + }, "webhookCount": { "type": "number" } } }, @@ -9085,9 +9894,17 @@ "type": "number" } } }, "endpoint": { + "type": "object", + "patternProperties": { + ".*": { + "type": "number" + } + } + }, + "integration": { "type": "object", "patternProperties": { ".*": { "type": "number" }