VSSL REST API
  • Introduction
  • GETTING STARTED
    • Introduction
    • START HERE!
    • Using a Raspberry PI
    • Installing the VSSL Agent
    • Discovery of the API
    • Sending requests
    • Reading the examples
  • ZONES
    • Get zones
    • Reboot a zone
  • ZONE CONTROL
    • Play Control
    • Volume
    • Mute
    • Set Party
    • Set Group
    • Priority
    • Set Analog Input Source
    • RampVolume
  • ANNOUNCEMENTS
    • Play an audio clip
  • SUPPORT
    • Feature request
    • Contact us
Powered by GitBook
On this page
  • Parameters
  • Response
  • Example Request
  • Example Response

Was this helpful?

  1. ANNOUNCEMENTS

Play an audio clip

PATCH /say

Parameters

Parameter

Data Type

Value

serial

string, required

the serial number of a vssl device

number

integer, required

the zone number.

volume

integer, required

the volume level to play the audio file (0-99).

url

string, required

the url where the audio file can be

note: the call will return immediately with either a failure message or an indication that the playback has been requested. It is possible for the playback to fail (e.g. the network can't retrieve the file, the file format is invalid, ...). Further status will be provided in the coming VSSL FW iterations.

note2: if this is the first time a playback has been requested then we will send a command to wake up the unit and wait a few seconds before playing the file. Otherwise, if the last playback was less then 15 minutes ago then we will play the clip immediately.

note3: this call allows you to play a file on 1 or all of the zones. If you want to play to a subset (e.g. zone 1,2) then you will need to make two calls, one for each zone you want to play the file on.

Response

Status of the call

Example Request

Sample HTTP request

$ curl --request PATCH http://localhost:8000/api/say?'serial=00BD27EF7210&number=2&volume=55&url=http://soundbible.com/grab.php?id=2190%26type=mp3'
IP: 192.168.0.15
Host: 8000
Data: "PATCH /api/say?'serial=00BD27EF7210&number=2&volume=55&url=http://soundbible.com/grab.php?id=2190%26type=mp3 HTTP/1.1\r\n\r\n"
$ http PATCH http://192.168.0.15:8000/api/say serial==00BD27EF657D number==2 volume==26 url=='http://soundbible.com/grab.php?id=2190&type=mp3'
const axios = require('axios');

axios.patch('http://192.168.0.15:8000/api/say', {
    params: {
      serial: '00BD27EF657D',
      number: 2, 
      volume: 26, 
      url: 'http://soundbible.com/grab.php?id=2190&type=mp3'
    }
  }).then((response)=>{
    console.log(response);
  }).catch((response)=>{
    console.log('Error making request');
  })

Example Response

{
  "status": "request sent"
}
PreviousRampVolume

Last updated 6 years ago

Was this helpful?