device/save

Registers or updates a device.

Authorization

Access JSON Web Token (RegisterDevice)

Request Topic and Payload

Topic

dh/request

Payload Representation

{
    "action": {string},
    "requestId": {object},
    "deviceId": {string},
    "device": {
        "name": {string},
        "data": {object},
        "networkId": {integer},
        "isBlocked": {boolean}
    }
}

Payload Parameters

Property NameRequiredTypeDescription
actionYesstringAction name: device/save
requestIdNoobjectRequest unique identifier, will be passed back in the response message.
deviceIdYesstringDevice unique identifier.
May contain only letters, digits and dashes.
deviceYesobjectA Device resource to register or update.
device.nameYesstringDevice display name.
device.dataNoobjectDevice data, a JSON object with an arbitrary structure.
device.networkIdYesintegerAssociated network id.
device.isBlockedNobooleanIndicates whether device is blocked.

Response Topic and Payload

Topic

dh/response/device/save@{clientId}

Payload Representation

{
    "action": {string},
    "status": {string},
    "requestId": {object}
}

Payload Parameters

Property NameTypeDescription
actionstringAction name: device/save
statusstringOperation execution status (success or error).
requestIdobjectRequest unique identifier as specified in the request message.