IP Audio Client API
Scope
This document is intended for users of IP Audio Client devices (Exstreamer M400, Exstreamer MPA400 and IP Former) who wants to interact with the devices via means of an API, thus enabling controls and monitoring functionality from a third party application.
In order to access the API the devices must run at least IP Audio Client firmware V2.9
Transport and format
The API is available over HTTP on port 80 or HTTPS on port 443
The message format used is JSON
Authentication
By default, the IPAC device always listens at incoming requests after boot. The API server can be disabled from the web interface at any time.
The authentication methods supported are:
Mechanism | Value | Description |
---|---|---|
None |
| Don’t use any authentication method |
API Key |
| Use the API Key generated by the device to authenticate the API communication. Use it in the request header |
By default, the chosen method is API Key, and the device uses a random API Key. The user can generate a new API Key in the Settings page of the web interface. When generating a new API Key the previous one becomes invalid.
API Methods
In the below chapters are the detailed descriptions of all the methods exposed in the API.
Image Version
GET Version
Get device image’s version.
Method | GET |
---|---|
Path | /api/v1/version |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
version |
| Image Version |
Master Volume Control
Set, get current volume and mute.
SET Volume
Set Master volume of the device. The value must be an integer between 0 and 100.
Method | PUT |
---|---|
Path | /api/v1/volume |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers | NONE |
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Required API Key is invalid or missing |
GET Volume
Get volume of the device. The volume value must be an integer between 0 and 100.
Method | GET |
---|---|
Path | /api/v1/volume |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Mute
This command causes the device to mute if the value is true or unmute if value is false.
Method | PUT |
---|---|
Path | /api/v1/mute |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers | NONE |
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Required API Key is invalid or missing |
SonicIP Control
Get SonicIP configuration, enable/disable it or set its volume.
GET SonicIP configuration
Method | GET |
---|---|
Path | /api/v1/sonicip |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
enabled |
| SonicIP enable/disable status |
volume |
| SonicIP volume level in % |
Enable/Disable sonicIP and/or set sonicIP volume
The volume value must be an integer between 0 and 100.
Method | PUT |
---|---|
Path | /api/v1/sonicip |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers | NONE |
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Required API Key is invalid or missing |
Reset to factory defaults
This command causes the device to reset to defaults. All settings are defaulted except the network configuration.
Method | PUT |
---|---|
Path | /api/v1/reset |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers | NONE |
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Failed to reset to defaults because new firmware is currently being installing | |
| Required API Key is invalid or missing |
Reboot device
This command causes the device to reboot.
Method | PUT |
---|---|
Path | /api/v1/reboot |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers | NONE |
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Failed to reboot device because new firmware is currently being installing | |
| Required API Key is invalid or missing |
System Status
Retrieve complete system status page of the device.
GET System Status
Method | GET |
---|---|
Path | /api/v1/status |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
hardwareType |
| Device hardware type |
ipamType |
| IPAM type (IPAM stands for IP Audio Module and is the core of every Barix IPAC device) |
mac |
| MAC Address |
linuxKernelVersion |
| Linux Kernel version |
bootloaderVersion |
| Bootloader version |
connection |
| Network connection: wired |
status |
| Network status: up or down |
dhcp |
| DHCP enable (true) or disabled (false) |
ipaddress |
| IP address |
netmask |
| Netmask |
defaultGateway |
| Default gateway |
type |
| DNS type: Auto or Manual |
primaryDNS |
| DNS primary IP Address (only if DNS type is Auto |
secondaryDNS |
| DNS secundary IP Address (only if DNS type is Auto |
time |
| System current time |
uptime |
| Uptime |
name |
| License name |
status |
| License status |
issueDate |
| License issue date |
expireDate |
| License expire date |
id |
| License id |
features |
| License features |
signature |
| License signature |
Network settings
Retrieve only the network configuration.
GET network
Method | GET |
---|---|
Path | /api/v1/network |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
avahiAnnounce |
| Avahi announce enabled: true or false (multicast-dns service for auto-discovery) |
sonicIP |
| SonicIP enabled: true or false |
sonicIpVolume |
| SonicIP volume between 0 and 100 ( % ) |
webProtocol |
| Protocol used by the internal web server to connect with clients: http or https |
dhcp |
| DHCP enable (true) or disabled (false) |
ipaddress |
| IP address |
netmask |
| Netmask |
defaultGateway |
| Default gateway |
type |
| DNS type: Auto or Manual |
primaryDNS |
| DNS primary IP Address (only if DNS type is Auto |
secondaryDNS |
| DNS secundary IP Address (only if DNS type is Auto |
Audio Sources
GET sources
Retrieve sources configuration.
Method | GET |
---|---|
Path | /api/v1/sources |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Configure all sources
The api supports two ways of setting audio sources’s configuration: by uploading a JSON file containing the configuration or by passing directly the JSON configuration in the body of the request.
Changing the source configuration causes a reload the settings of the application, if the device is playing the moment the request is sent its output will be shortly silenced.
A - Upload a json file containing sources’s configuration
Method | PUT |
---|---|
Path | /api/v1/sources |
Request Headers |
CODE
|
Request Body |
HTML
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Required API Key is invalid or missing |
B - Send sources’s configuration as request data
Method | PUT |
---|---|
Path | /api/v1/sources |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Required API Key is invalid or missing |
Specific source configuration examples
Barix Radio
Request Body |
JSON
|
---|
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
InformaCast
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| InformaCast server url |
| automatic InformaCast server discovery | |
|
| Idle audio url |
|
| Idle audio format |
| Idle audio format |
No Equalizer configuration allowed for InformaCast - SynApps and SIP sources.
Syn-apps
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| Syn-apps server’s IP address |
| automatic Syn-apps server discovery |
No Equalizer configuration allowed for InformaCast - SynApps and SIP sources.
SIP
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| Peer-to-peer SIP mode |
| Server Sip mode | |
| Server and Peer-to-peer mode | |
|
| Playback buffer in milliseconds |
|
| Maximum duration of an established call, in seconds. Set 0 to disable |
|
| Timeout that the SIP client should wait to close the current call in the case it does not detect audio from the remote side. Set 0 to disable |
|
| Server Domain name or IP address. |
|
| SIP account user name. |
|
| SIP account user password. |
|
| UDP Transport with no security (port 5060) |
| SIP Secure with TLS transport (port 5061) | |
| SIP Secure (port 5061) and Media Encryption | |
|
| Registration Timeout: interval for registration, in seconds. Range: 5 to 300 seconds. |
|
| Registration Retry Interval: interval of auto registration retry upon registration failure,in seconds. |
Note: Parameters in blue rows are only mandatory for “server” and “server_and_peer_to_peer” SIP modes.
No Equalizer configuration allowed for InformaCast - SynApps and SIP sources.
HTTP
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| URL of HTTP/S stream |
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
RTP
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| URL of RTP stream |
|
| plays back audio maintaining a constant delay in place, which is the same across multiple devices that are part of a system. This allows the possibility to keep a synchronized playout. |
| plays with the lowest possible latency |
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
Local File
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| Trigger UDP port (between 8000 and 8999) used to receive the UDP datagram to trigger audio file play. |
|
| loop (true or false) to allow audio file to be played in loop |
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
USB
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| path to a specific music folder inside the pen-drive i. e. this/is/my/folder . Leave this empty to use the pen-drive base path. |
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
Paging (IC Paging)
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| Simple paging |
| IC paging | |
|
| Unique identifier of this paging endpoint. |
|
| IP Address used by client to listen/send on the BARP ports. Modify the BARP IP address to use multicast if communication across different networks is desired, or if your LAN policy is not allowing broadcast. Default: 0.0.0.0 |
|
| Local BARP port number to which the master will send audio for paging and established calls. If the multicast port and address are configured, this port will be used only for incoming calls. Paging will be done using the multicast group. Default: 5555 (use any unused port between 5555 - 5999) |
|
| Local BARP port number to receive control messages from the master. Default: 5556 (use any unused port between 5555 - 5999) |
|
| Destination BARP port number to send status messages to the master. Default: 5557 (use any unused port between 5555 - 5999) |
|
| 24Khz |
| 8Khz | |
|
| u-law |
| a-law |
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
Paging (Simple Paging)
Request Body |
CODE
|
---|
Specific parameters:
Parameter | Values | Description |
---|---|---|
|
| Simple paging |
| IC paging | |
|
| Unique identifier of this paging endpoint. |
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
Scheduler
Request Body |
CODE
|
---|
Note: The equalizer setting is not mandatory. The default equalizer setting will be used if equalizer parameter is missing. Please check #equalizer-source-configuration
Equalizer source configuration
IPAC uses a four-band equalizer. Its configuration must be embedded in the “config” parameter of the body of the call. See below example:
|
CODE
|
---|
Each band of the EQ offers the following controls:
Band Parameter | Value (default) | Range | Description |
---|---|---|---|
|
| Equalizer Band Name | |
|
| 20 to 400 | Equalizer Central Frequency (Hz) |
|
| Q-factor band-width type | |
|
| 0.1 to 8 | Q-factor value |
|
| -24 to 24 | Gain (dB) |
LOW-MID Equalizer Band Parameter | Value (default) | Range | Description |
---|---|---|---|
|
| Equalizer Band Name | |
|
| 80 to 1000 | Equalizer Central Frequency (Hz) |
|
| Q-factor band-width type | |
|
| 0.1 to 8 | Q-factor value |
|
| -24 to 24 | Gain (dB) |
HI-MID Equalizer Band Parameter | Value (default) | Range | Description |
---|---|---|---|
|
| Equalizer Band Name | |
|
| 800 to 12500 | Equalizer Central Frequency (Hz) |
|
| Q-factor band-width type | |
|
| 0.1 to 8 | Q-factor value |
|
| -24 to 24 | Gain (dB) |
HI Equalizer Band Parameter | Value (default) | Range | Description |
---|---|---|---|
|
| Equalizer Band Name | |
|
| 2500 to 20000 | Equalizer Central Frequency (Hz) |
|
| Q-factor band-width type | |
|
| 0.1 to 8 | Q-factor value |
|
| -24 to 24 | Gain (dB) |
SET source enable/disable
Enable or disable an audio source. The id is an integer value between 1 and 5.
Note: IPAC application will be restarted if the value being set is different from the current configured value.
Method | PUT |
---|---|
Path | /api/v1/source/enable |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Source is not configured | |
| Required API Key is invalid or missing |
SET source volume (excluding “scheduler”)
Set volume for a specific audio source. The id is an integer value between 1 and 5. The volume is an integer between 0 to 100.
Method | PUT |
---|---|
Path | /api/v1/source/volume |
Request Headers |
NONE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Source is not configured | |
| Required API Key is invalid or missing |
SET Source Volume (“scheduler”)
Volume parameters must be an integer between 0 to 100.
Method | PUT |
---|---|
Path | /api/v1/source/volume |
Request Headers |
NONE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Source is not configured | |
| Required API Key is invalid or missin |
GET Source status
Retrieve the current status for all audio sources.
Method | GET |
---|---|
Path | /api/v1/sources/status |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Audio Files
GET all files
Get a list with the names of all the audio files stored on the device.
Method | GET |
---|---|
Path | /api/v1/audio-files |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Upload an Audio File
This command will be used to upload an audio file to IPAC device.
Supported audio file extensions: "mp3", "aac", "flac", "ac3", "dts", "wav", "ogg", "m4a", "zip"
Method | POST |
---|---|
Path | /api/v1/file/upload |
Request Headers |
CODE
|
Request Body |
HTML
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Required API Key is invalid or missing |
Delete an audio file
This command will be used to delete an audio file that is stored on IPAC device.
Method | DELETE |
---|---|
Path | /api/v1/file/delete |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| ||
| Required API Key is invalid or missing |
Trigger to play an audio file
This command will try to play a specific audio file by specifying the correct LocalFileAudio source id. The id is an integer value between 1 and 5.
Method | PUT |
---|---|
Path | /api/v1/file/play |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Source is not configured as a local file audio source | |
| ||
| Source id is still playing an audio file | |
| Required API Key is invalid or missing |
Trigger to stop playing an audio file
This command will order a specific Local File audio source id to stop playing an audio file. The id is an integer value between 1 and 5.
Method | PUT |
---|---|
Path | /api/v1/file/stop |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Source is not configured as a local file audio source | |
| Required API Key is invalid or missing |
GET status of audio file playing
By specifying Local File Audio source id (integer value between 1 and 5) you’ll get the information regarding:
audio file name currently playing;
the status:
playing
stopped
Method | GET |
---|---|
Path | /api/v1/file/status |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Inputs / Outputs
Inputs and Outputs calls are only supported on hardware where inputs and outputs interfaces are present. e.g. Annuncicom MPI400
GET Input
Retrieves the current status of the dry contact digital input interface
Method | GET |
---|---|
Path | /api/v1/inputs |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
GET Relays
Retrieves the current status of the relays
Method | GET |
---|---|
Path | /api/v1/relays |
Request Headers |
CODE
|
Request Body | NONE |
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
SET relay
Activate/deactivate a specific relay:
relayX key, where X is specifies the relay index number
value: “1” - activate or “0” - deactivate
Note: the user must allow API relay configuration on the web interface for the intended relay to be controlled via API
Method | PUT |
---|---|
Path | /api/v1/relay |
Request Headers |
CODE
|
Request Body |
JSON
|
Response Status | 200, 400, 401, 404, 500 |
Response Headers |
CODE
|
Response Body |
JSON
|
Description and examples of the response body:
key | values | description |
---|---|---|
result |
| Success |
| Invalid or missing parameters | |
| Relay configuration is not allowed | |
| Required API Key is invalid or missing |