Response Body

When the device posts measures in the protobuf format, it receives a detailed status response which is also in the protobuf format. The device must check the Content-Type HTTP header because a different content type may be returned by an HTTP proxy, or no response body at all may be returned in some cases.

The definition of the corresponding type in the proto3 syntax is provided in the following sample. All fields are optional. More fields can be added in future versions of the IoT Gateway.

message MeasureResponse {
int32 code = 1; // the same as the HTTP status code
string id = 2; // not returned by the current version
int64 timestamp = 3; // not returned by the current version
string sensorAlternateId = 4; // value from the request
string capabilityAlternateId = 5; // value from the request
repeated string messages = 6; // a list of human-readable strings, 
                                 // mostly error messages, generated during
                                 // the verification of the measure message
}

The current version of the IoT Gateway does not support the protobuf format for batched measure messages. Therefore, neither individual identifiers nor individual timestamps for measure messages are needed.

The messages field can contain any human-readable error messages. There is no fixed list of allowed values, but the messages may start with the strings listed in the following table.

Typical error messages are described in the following table.

Message

Condition

Unauthorized

The client is not authorized to post the measure messages on behalf of the device. In particular, this may mean an HTTP authentication failure.

Invalid device alternate ID

Most likely to appear when a valid and authenticated router device posts measure messages on behalf of another one.

Invalid message format

This means that the whole payload could not be parsed, for example due to invalid JSON syntax. The sensor and device alternate IDs, etc., cannot be extracted in this case.

Invalid sensor alternate ID

The sensor does not exist and could not be onboarded automatically.

Invalid capability alternate ID

The capability does not exist for the sensor, or it does not accept measures (being of the command type).

Invalid property alternate ID

The property does not exist in the capability.

Illegal property value

The value is not acceptable for the reason specified in the same error message. The message can be used if the measure is posted as a list with a wrong number of elements. It can also be used when the value for a certain property cannot be converted to the corresponding type.

No valid measurement data found

No property of the capability was assigned a valid value.

Illegal time stamp value

The time stamp provided by the client for the measure message could not be parsed.

Gateway configuration error

Typically returned for a wrongly configured IoT Gateway Edge. However, it may also be sent if there are errors in the data model, such as a capability without any properties.

Gateway internal error

Some other error was detected, and an internal consistency check has failed in the IoT Gateway.