Common Parameter Description


The following table describes the common parameters used in the request and response messages.

Parameter

Type

Mandatory/Optional

Description

id

String

Optional

The message ID. This is a reserved parameter that is reserved for future use.

version

String

Mandatory

The version of the protocol.

params

JSON

Mandatory in request

The request parameters, in JSON format, which can either be array or dict.

method

String

Mandatory in request

The name of the method.

code

Integer

Mandatory in response

The return code. For a list of common return codes, see Common Return Codes

data

JSON

Optional

The information that is returned. Depending on the return value, it can be in array or dict format.

Common Return Codes

The following list contains common return codes that apply to all EnOS MQTT topics. For return codes that are unique to an MQTT topic, go to the specific topic article in this Device Protocol for MQTT section.

Return Code

Error Message

Explanation

1220

Payload format error

Payload contains invalid JSON format.

1251

Payload is empty

Payload does not contain any content.

1260

Methods not consistent

The method and topic in the MQTT message do not match.

1008

Msg size is too large, discard the message

The MQTT message size is too large.

1009

Publish to topic with no write permission

The MQTT topic is not supported, or the device that tried to publish data to the MQTT topic has not logged in to EnOS.