📘

Only HDL310 and HDL410 devices support this command

Allows clients to increment or decrement volume on a device by 4-6 every time a command is sent. The lowest volume is 0 and the highest is 100.

A request body must be included. The only supported operations are 'increment' and 'decrement' (case sensitive). If the request was successful, the request, requestId and clientId will be echoed back as a response.

If there is no valid request body, or an error has occurred, then the WebSocket will respond with an appropriate status code and message.

OperationDescription
incrementThis will attempt to increment the speaker volume by 4-6, to a maximum of 100.
decrementThis will attempt to decrement the speaker volume by 4-6, to a minimum of 0.

Request

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": string,
  "clientId": string,
  "body": {
    "operation": string
  }
}

Response

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": string,
  "clientId": string
}

Errors

Status codeDescription
10000 – Bad requestRequest does not conform to the specification. The message field will include detailed information about which part of the request is incorrect.
12001 – Unsupported attributesRequest body does not conform to the specification. The message field will include detailed information about which part of the request body is incorrect.

Sample requests

1. Valid request/response to increment the speaker volume

Request

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "3abe203s-42b7-4b0b-9awaf-5c381793a192",
  "clientId": "test",
  "body": {
    "operation": "increment"
  }
}

Response

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "3abe203s-42b7-4b0b-9awaf-5c381793a192",
  "clientId": "test"
}

2. Valid request/response to decrement the speaker volume

Request

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "3abe203s-42b7-4b0b-9awaf-5c381793a192",
  "clientId": "test",
  "body": {
    "operation": "decrement"
  }
}

Response

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "3abe203s-42b7-4b0b-9awaf-5c381793a192",
  "clientId": "test"
}

3. Invalid request - no requestId or clientId

Request

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "",
  "clientId": ""
}

Response

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "",
  "clientId": "",
  "errors": [
    {
      "statusCode": 10000,
      "message": "clientId: String can't be empty or whitespace"
    },
    {
      "statusCode": 10000,
      "message": "requestId: String can't be empty or whitespace"
    }
  ]
}

4. Invalid request - bad body

This is an invalid request, since the only operations supported are increment and decrement.

Request

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "3abe203s-42b7-4b0b-9awaf-5c381793a192",
  "clientId": "test",
  "body": {
    "operation": "min"
  }
}

Response

{
  "request": "v1/devices/commands/changeSpeakerVolume",
  "requestId": "3abe203s-42b7-4b0b-9awaf-5c381793a192",
  "clientId": "test"
  "errors": [
    {
      "statusCode": 12001,
      "message": "Unsupported Attributes: operation. Invalid enum value. Expected 'increment' | 'decrement', received 'min'"
    }
  ]
}