Measure Message Format (JSON)
After a device has been successfully registered and a certain sensor has been assigned, the device can start sending messages that conform to a capability defined for the respective sensor type.
Single Measures
Timestamp
For each measure, the timestamp can be reported. Device Connectivity use timestamp to order the measurement samples returned by Device Connectivity API. If a timestamp is not specified in the ingestion payload, the time of arrival of the message will be referenced.
-
Message Timestamp
As described in the schema above, you can specify the ingestion time for the whole message through the property timestamp. Both formats, ISO 8601 and a Unix time in milliseconds from epoch (that is a 13-digit number), are allowed. -
Measure Timestamp
If you have modeled a capability with a property of type date, you can use it to specify the measure timestamp (that is the timestamp of the sample).Both formats, ISO 8601 and a Unix time in milliseconds from epoch (that is a 13-digit number), are allowed.
Looking at the example above, the payload includes a message that conforms to a capability with alternate ID capability2. The measures are for the sensor with the alternate ID sensor2. The measure contains three properties, namely Pressure, Temperature, and Timestamp (with the property Timestamp of type date). These fields are part of the respective capability definition.
-
You want to use one of the properties of the device as timestamp of the measure.
-
You want to send a single message with batched measures, for example, a message containing more samples for the capability, each one with a different timestamp (as for a default time series).
Batched Measures
Timestamp
-
Message Timestamp
If you specify the timestamp as message timestamp, it will be applied to all the samples (for example, in this case both, the first and the second samples, will have the same ingestion timestamp 1413191650000)
-
Measure Timestamp
-
If you have modeled a property as type date, its value will result in the ingestion timestamp of each sample on the platform.
For example, in this case you have two samples, the first one with 1413191650000 as ingestion timestamp and the second one with 1413191790000.
-
If you have specified a _time property, without having modeled it as a property of the capability, its value will result in the ingestion timestamp of each sample on the platform.
For example, in this case you have two samples, the first one with 1413191650000 as ingestion timestamp and the second one with 1413191790000.
-