Represents a command-response request in the ESP RainMaker SDK.

Returned by ESPRMNode.createCmdRespRequest, ESPRMUser.createCmdRespRequest, and list/lookup helpers. Use getStatus to fetch the latest state from the cloud and cancel to cancel a pending request.

Implements

Constructors

Properties

cmdId: number

Command id associated with this request.

Device-reported status code.

expirationTimestamp: number

Epoch timestamp when the request expires.

indefiniteTimeout?: boolean

When true, the request has no expiry and waits indefinitely for a device response.

isBase64?: boolean

When true, the request data was base64-encoded.

nodeId: string

Target node id.

requestData: string | Record<string, unknown>

Payload sent with the command request.

requestDataError?: ErrorDeserializeJson

Present only when the stored request payload could not be deserialized. When set, requestData should be treated as absent or null.

requestId: string

The unique request id returned when the command was queued.

requestTimestamp: number

Epoch timestamp when the request was created.

responseData?: null | string | Record<string, unknown>

Payload returned by the device, when the request has completed.

responseDataError?: ErrorDeserializeJson

Present only when the stored response payload could not be deserialized. When set, responseData should be treated as absent or null.

responseTimestamp: number

Epoch timestamp when the device responded.

Current status of the command-response request.

statusDescription: string

Human-readable status description from the device or backend.

userName?: string

Username of the user who created this request.

Methods