command/insert

Creates new device command.

Authorization

Access JSON Web Token (CreateDeviceCommand)

Request Topic and Payload

Topic

dh/request

Payload Representation

{
    "action": {string},
    "requestId": {object},
    "deviceId": {string},
    "command": {
        "command": {string},
        "timestamp": {datatime},
        "parameters": {object},
        "lifetime": {integer},
        "status": {string},
        "result": {object}
    }
}

Payload Parameters

Property NameRequiredTypeDescription
actionYesstringAction name: command/insert
requestIdNoobjectRequest unique identifier, will be passed back in the response message.
deviceIdYesstringTarget device unique identifier.
commandYesobjectA DeviceCommand resource to create.
command.commandYesstringCommand name.
command.timestampNodatetimeCommand UTC datetime (yyyy-MM-dd'T'HH:mm:ss.SSS ISO 8601).
command.parametersNoobjectCommand parameters, a JSON object with an arbitrary structure.
command.lifetimeNointegerCommand lifetime, a number of seconds until this command expires.
command.statusNostringCommand status, as reported by device or related infrastructure.
command.resultNoobjectCommand execution result, an optional value that could be provided by device.

Response Topic and Payload

Topic

dh/response/command/insert@{clientId}

Payload Representation

{
    "action": {string},
    "status": {string},
    "requestId": {object},
    "command": {
        "id": {integer},
        "timestamp": {datetime},
        "lastUpdated": {datetime},
        "userId": {integer}
    }
}

Payload Parameters

Property NameTypeDescription
actionstringAction name: command/insert
statusstringOperation execution status (success or error).
requestIdobjectRequest unique identifier as specified in the request message.
commandobjectAn inserted DeviceCommand resource.
command.idintegerCommand identifier.
command.timestampdatetimeCommand UTC datetime (yyyy-MM-dd'T'HH:mm:ss.SSS ISO 8601).
command.lastUpdateddatetimeLast command update UTC datetime (yyyy-MM-dd'T'HH:mm:ss.SSS ISO 8601).
command.userIdintegerAssociated user identifier.