Polls new device commands.

This method returns all device commands that were created after specified timestamp.

In the case when no commands were found, the method blocks until new command is received. If no commands are received within the waitTimeout period, the server returns an empty response. In this case, to continue polling, the client should repeat the call with the same timestamp value.

Request

HTTP Request

GET /device/{deviceId}/command/poll?timestamp={timestamp}&names={names}&waitTimeout={waitTimeout}

Parameters

Parameter NameRequiredTypeDescription
deviceIdYesstringDevice unique identifier.
timestampNodatetimeUTC datetime (yyyy-MM-dd'T'HH:mm:ss.SSS ISO 8601) of the last received / last updated (if returnUpdatedCommands selected) command. If not specified, the server's datetime is taken instead.
returnUpdatedCommandsNobooleanChecks if updated commands should be returned. If not specified, default value is false.
namesNostringComma-separated list of commands names.
waitTimeoutNolongWaiting timeout in seconds (default: 30 seconds, maximum: 60 seconds). Specify 0 to disable waiting.
limitNointegerLimits number of commands.

Authorization

Access JSON Web Token (GetDeviceCommand)

Request Body

Do not supply a request body with this method.

Response

If successful, this method returns array of DeviceCommand resources in the response body.

Property NameTypeDescription
idintegerCommand identifier.
commandstringCommand name
timestampdatetimeCommand UTC datetime (yyyy-MM-dd'T'HH:mm:ss.SSS ISO 8601).
lastUpdateddatetimeLast command update UTC datetime (yyyy-MM-dd'T'HH:mm:ss.SSS ISO 8601).
userIdintegerAssociated user identifier.
deviceIdstringDevice unique identifier.
networkIdintegerNetwork unique identifier.
deviceTypeIdintegerDevice type unique identifier.
parametersobjectCommand parameters, a JSON object with an arbitrary structure.
lifetimeintegerCommand lifetime, a number of seconds until this command expires.
statusstringCommand status, as reported by device or related infrastructure.
resultobjectCommand execution result, an optional value that could be provided by device