Skip to main content

Common Objects

ReferenceAudience: API consumerUse: look up the structure and constraints of an envelope or a primitive type

These definitions are shared by many messages. Field meanings in context are on the operation pages; how to use the envelopes is on Message Envelopes and Correlation and Correlation and Request/Response Pairing.

Envelopes​

Each command, response, and event message combines one of these member sets with its own members. The contract repeats them in every message rather than referencing a shared definition.

commandEnvelopeBase​

The members every command carries.

FieldTypeRequiredDefaultLimitsMeaning
commandcommandNameYesThe command to run
requestIdstringYesYour correlation identifier, echoed in the reply

responseEnvelopeBase​

The members every command response carries. The delete_wifi_profile response does not declare apiVersion.

FieldTypeRequiredDefaultLimitsMeaning
commandcommandNameYesThe command being answered
requestIdstringYesThe requestId of the request being answered
apiVersionapiVersionYesVersion reported by the command handler
responseobject (responseStatus)YesThe outcome of the command. The set_os response does not require it.

responseStatus​

The response object in every command response.

FieldTypeRequiredDefaultLimitsMeaning
codeinteger (statusCode)Yes0–101Numeric outcome
descriptionstringYesHuman-readable text. Don't parse it.

The contract requires code. Readers have been reported to omit it on a successful reply, sending { "description": "Success" }; treat that as success. See Success Without a Code.

eventEnvelopeBase​

The member that heartBeatEVT, alerts, and dataEVT share. mqttConnEVT does not require it, because its DISCONNECTED form carries no timestamp.

FieldTypeRequiredDefaultLimitsMeaning
timestampstringYesformat date-timeWhen the reader generated the event

Primitive Types​

The contract declares these members as plain strings and integers. It has no named primitive types and no patterns; the only limits are the ones below.

MemberJSON typeLimits in the contractNotes
requestIdstringNoneChosen by your application. Treat it as opaque.
timestampstringformat: date-time, an annotation that Draft 07 does not enforceEvery value in the contract's examples is UTC with a Z suffix and millisecond precision.
tenantIdstring48 characters, stated in its descriptionAn overlong value returns code 27.
urlstringNoneBroker host name or IP address
portintegerNoneTCP port
keepAliveintegerMaximum 65535Seconds
topicstringNoneDon't use + or # in a publish topic.
clientIdstringNoneSee Client ID.
chargePercentageintegerMaximum 100Percentage

The serial number that the reader appends to every topic is not a payload member. It is the model-prefixed serial, for example RFD40-212735201D0053; see Serial Number Forms.

Related: 📕 Message Envelopes and Correlation · 📕 MQTT Endpoints · 📕 Enumerations

Was this helpful?