Schema Definitions/Post
Description: To create a new Schema Definition.
Request – Schema Definitions/Post
Property
Type
Description
Mandatory
name
String
The name of the schema
parserType
String/Enum
Parser Type – the type of the incoming payload.
JsonParser – the payload is JSON
StringParser – the payload is String.
LorawanParser – the payload is Lorawan.
schemaOptions
Object
The definition of the schema.
schemaOptions/bulk
Object
For use cases where the incoming payload is array.
schemaOptions/bulk/porpertyName
String
The property that indicates the array in the payload.
schemaOptions/bulk/isEnabled
Boolean
Default = true, should it parse the payload as array. If no property name is declared, it will consider the json as array on the root level.
schemaOptions/autoDiscovery
Object
Auto Discovery is the option where new devices are added automatically to IoT Platform upon their first event arrival.
schemaOptions/autoDiscovery/enabled
Boolean
Default = true, Is Auto Discovery enabled.
schemaOptions/autoDiscovery/customIdRegexFilter
String
Regex to filter the creation of specific devices. The regex is applied on the device customId.
schemaOptions/autoDiscovery/customFunction
String
Function that runs as part of the auto discovery action.
schemaOptions/decryptPayloadFunction
String
JavaScript function that will decode the incoming payload before it enters the schema parsing.
schemaOptions/constants
List of Schema Constant objects
A key value object that includes constant for the schema to use.
schemaOptions/constants/key
String
The key of the constant
schemaOptions/constants/value
String
The value of the constant
jsonSample
Object
Payload sample of the schema
jsonSample/content
String
The json content.
jsonSample/name
String
The name of the sample.
jsonSample/updateDate
String
The date where the sample was updated.
schema
List of SchemaObject Objects
schema/attributePath
String
The name of the json key.
schema/convertInfo
Object
schema/convertInfo/functionType
String/Enum
The type of functions
undefined.
customFunction – user defined function.
multiply – multiply the value by the specified parameter.
decToHex – convert the value from decimal to hex.
hexToDec – convert the value from hex to decimal.
epochToDateTime – epoch date time to iso8601 format.
substring – extract the characters of the value between the two specified parameters.
schema/convertInfo/parameters
List of Strings
The parameters for the predefined function.
schema/covertInfo/customFunction
String
JavaScript function.
schema/actionType
String/Enum
The IoT Platform type of json key
Event – the json key is Event.
Patch – the json key that should patch the device property.
CustomId – The external device identifier.
Datetime – the json key that indices the event time.
schema/event
Event Schema Object
Describes how to build the event.
schema/event/name
String
The event name.
schema/event/typeCode
Integer
The event type code.
schema/event/unit
String
The event unit.
schema/patch
Patch Schema Object
The name of the property to patch in the device.