Time Stamped Payloads

Time Stamped Payloads

In the Zoho IoT application, data extracted from incoming payloads is stored as time-series data in a datapoint. By default, the timestamp assigned to each record is the exact time at which the application receives the message.

For example, if the following payload is received at 10:05:30,

{
        "temperature": 20,
        "humidity": 67
}

The stored record will automatically be assigned the timestamp 10:05:30.

Providing a Custom Timestamp

Zoho IoT allows you to override the default timestamp by including a custom timestamp in the payload. This enables you to store data with the exact time at which it was originally generated.

This is particularly useful when the edge device collects data at frequent intervals (e.g., every 5 minutes). But, transmits data in batches (e.g., once every 30 minutes).

For instance, if the device sends data at 10:30 AM containing readings collected at 10:05, 10:10, 10:15, 10:20, 10:25, and 10:30, each reading must include its corresponding timestamp using the data_ts key.

Example payloads:

{
        "temperature": 20,
        "humidity": 67,
        "data_ts": 1772186700000
}
____________
{
        "temperature": 21,
        "humidity": 65,
        "data_ts": 1772187000000
}
_____________
{
        "temperature": 22,
        "humidity": 63,
        "data_ts": 1772187300000
}
_____________
{
        "temperature": 23,
        "humidity": 62,
        "data_ts": 1772187600000
}
_____________
{
        "temperature": 24,
        "humidity": 60,
        "data_ts": 1772187900000
}
_____________
{
        "temperature": 25,
        "humidity": 58,
        "data_ts": 1772188200000
}
NotesNote: Each reading must be sent as an individual payload. Multiple timestamped readings must not be combined into a single array payload.

Timestamp Requirements and Limitations

  • The data_ts field must be present at the root level of the payload.
  • Each payload can contain only one timestamp instance.
  • The timestamp must be in milliseconds (Unix epoch format).
  • The timestamp must not be in the future relative to the message send time. For example, if the payload is sent at 25 July 2025, 9:00 AM, the timestamp must not be later than that time (e.g., 9:45 AM is invalid).

Valid Structure Example

A single timestamp applied at the root level with multiple device objects:

{
        "data_ts": 1772188200000,
        "device_1": {
                "temperature": 25,
                "humidity": 58
              },
        "device_2": {
               "temperature": 25,
                "humidity": 58
              }
}

Invalid Structure Example

Multiple timestamped entries sent as an array in a single payload:
[
        {
          "device_1": {
                  "temperature": 25,
                  "humidity": 58,
                  "data_ts": 1772188200000
                }
        },
        {
          "device_1": {
                  "temperature": 25,
                  "humidity": 58,
                  "data_ts": 1772188203000
                }
        },
        {
          "device_1": {
                  "temperature": 25,
                  "humidity": 58,
                  "data_ts": 1772188206000
                }
        }
]

This structure is not supported.

By including the data_ts field correctly, Zoho IoT ensures that time-series data is stored in the intended chronological order, even when messages are transmitted in batches.