2N® IP Audio Manager HTTP REST API Manual
2N® IP Audio Manager REST HTTP API v1
[ Base URL: /api/v1 ]
Info
Simple description of HTTP REST API for IP Audio Manager control. File can be viewed using http://editor.swagger.io/
Address
Url API is versioned, using https, url looks like folowing: https://server_address/api/v1/endpoint
, where
server_address
– ip address of serverendpoint
– description in Paths sections.
HTTP
The following HTTP command set is used for server communication:
GET
– list of objectsPUT
– object parameter changePOST
– object creation or action assignmentDELETE
– object deletion
Data structure
Server request
Structure of request:
{
"data": ...
}
Every request is packed in "data" object. If there is a remark Read only
in parameter description, parameter can only by accesed via GET command, but it is not possible to modify this parameter using POST or PUT.
Server response
Response structure:
{
"data": ...
}
Everey response is packed in "data" object.
{
"meta":
{
"code": 200
},
"data": ...,
"pagination":
{
"next_url": "...",
"next_max_id": "13872296"
}
}
Errors
401
– not authtorized (user is not logged in)403
– no rights (logged user has insufficient rights for this operation)500 and more
– errors
Structure looks like folowing:
{
"data": {
number:123456
messagge:"example"
}
}
messagge
– detailed description of the errornumber
– error number (can be used in client for viewing localized description to user)
Authentization
Authentication is based on tokens that are transmitted in a cookie. The client sends the /login
request including its login name and password. If authentication is valid, the server sets the cookie in the browser. From now on, the client (browser) will send all requests to the server with this cookie and the server will validate the token in the cookie. If the token is invalid, the server returns error 401
. When the /logout
request is sent, the token will be deleted from the database If a user logs in via multiple browsers (via more PCs or one PC with multiple suppliers' browsers) at the same time, there are more tokens for one user in the database at a moment. Logging out of one browser the user is not logged out of the others. The token for a session is deleted automatically from the database after the logged-in user keeps idle for 60 minutes
.
Version Number and Tags
not implmentedNot implemented on the server.
Not implemented on the server.
userObjects for authorization and user settings.
Objects for authorization and user settings.
Returns user settings.
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
Responses
Code | Description |
200 | Returns user settings.
|
401 | Not authorized. |
500 | Error.
|
User login.
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
user * object (body) |
|
Responses
Code | Description |
200 | Returns user settings
|
401 | Not authorized. |
500 | Error.
|
User logout.
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
Responses
Code | Description |
200 | User was logged out. |
401 | Not authorized. |
Change user settings.
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
user * object (body) |
|
Responses
Code | Description |
200 | Returns user settings.
|
401 | Not authorized. |
500 | Error.
|
schedulerObjects for controling the scheduler.
Objects for controling the scheduler.
Delete day plan.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
Responses
Code | Description |
200 | Day plan deleted.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Remove destinations from day plan.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
destinations * array[object] (body) | List of removed destinations.
|
Responses
Code | Description |
200 | Destinations removed, returns list of day plan destinations.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Delete day plan exception.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
exceptionId * string (path) | Exception Id. |
Responses
Code | Description |
200 | Day plan exception deleted.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Delete day plan record.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
recordId * string (path) | Record id |
Responses
Code | Description |
200 | Day plan record deleted.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Delete holiday.
Parameters
Name | Description |
---|---|
holidayId * integer (path) | Holiday id. |
Responses
Code | Description |
200 | Holiday deleted.
|
401 | Not authorized. |
500 | Error.
|
Returns day plans in month.
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
year * string (path) | rok |
month * string (path) | mesic |
Responses
Code | Description |
200 | Array of day events.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns array of day plans events in a week.
Parameters
Name | Description |
---|---|
year * string (path) | year |
week * string (path) | week |
Responses
Code | Description |
200 | Array of day plans events.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns day plans.
Parameters
No parameters
Responses
Code | Description |
200 | Array of day plans.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns detail of day plan.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
Responses
Code | Description |
200 | Detail of day plan.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Returns day plan destinations.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
Responses
Code | Description |
200 | Returns day plan destinations.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Returns day plan exceptions.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
Responses
Code | Description |
200 | Array of day plan destinations.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Returns detail of day plan exception.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
exceptionId * string (path) | Exception id. |
Responses
Code | Description |
200 | Detail of day plan exception.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Returns day plan records.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
Responses
Code | Description |
200 | Array of day plan records.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns detail of day plan record.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
recordId * string (path) | Record id |
Responses
Code | Description |
200 | Detail of day plan record.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns list of possible commands.
Parameters
No parameters
Responses
Code | Description |
200 | List of commands.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns list of zones. Zones are located in a tree, there can be another zone in zone.
Parameters
No parameters
Responses
Code | Description |
200 | List of zones.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns list of holidays.
Parameters
No parameters
Responses
Code | Description |
200 | List of holidays.
|
401 | Not authorized. |
500 | Error.
|
Returns detail of holiday.
Parameters
Name | Description |
---|---|
holidayId * integer (path) | Holiday id |
Responses
Code | Description |
200 | Detail of holiday.
|
401 | Not authorized. |
500 | Error.
|
Creates day plan.
Parameters
Name | Description |
---|---|
name * object (body) | Day plan name.
|
Responses
Code | Description |
200 | Day plan crated, returns its details.
|
401 | Neautorizován. |
403 | Insufficent rights. |
500 | Error
|
Creates day plan exception.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
exception * object (body) | Exception.
|
Responses
Code | Description |
200 | Excepion created, returns its detail.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Creates record in day plan.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id |
settings * object (body) | Record settings
|
Responses
Code | Description |
200 | Record created, returns its detail.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Create holiday.
Parameters
Name | Description |
---|---|
createHoliday * object (body) | Holiday settings
|
Responses
Code | Description |
200 | Create new holiday.
|
401 | Not authorized. |
500 | Error.
|
Change day plan settings.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
dayPlan object (body) | plan
|
Responses
Code | Description |
200 | Day plan changed, returns its detail.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Insert destinations to day plan.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
destinations * array[object] (body) | List of inserted destinations.
|
Responses
Code | Description |
200 | Destinations inserted, returns list of day plan destinations.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Change day plan exception settings.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
exceptionId * string (path) | Exception Id. |
exception * object (body) | Exception.
|
Responses
Code | Description |
200 | Exception changed, returns its detail.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Chenge day plan record.
Parameters
Name | Description |
---|---|
dayplanId * string (path) | Day plan id. |
recordId * string (path) | Record id |
Responses
Code | Description |
200 | Record changes, returns its detail.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error
|
Change holiday settings.
Parameters
Name | Description |
---|---|
holidayId * integer (path) | Holiday id |
editHoliday * object (body) |
|
Responses
Code | Description |
200 | Holiday changed, return its detail.
|
401 | Not authorized. |
500 | Error.
|
sessionObject for controling sessions.
Object for controling sessions.
Delete session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Session was deleted. |
401 | Not authorized. |
500 | Error.
|
Delete session source.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Source was deleted. |
401 | Not authorized. |
500 | Error.
|
Delete session destination.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
destinationId * integer (path) | Destination ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Destination was deleted. |
401 | Not authorized. |
500 | Error.
|
Returns list of zones. Zones are located in a tree, there can be another zone in zone.
Parameters
No parameters
Responses
Code | Description |
200 | List of zones.
|
401 | Not authorized. |
403 | Insufficent rights. |
500 | Error.
|
Returns the list of all Sessions
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
Responses
Code | Description |
200 | List of Sessions.
|
401 | Not authorized. |
500 | Error.
|
Returns properties of a specific Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Session properties.
|
401 | Not authorized. |
500 | Error.
|
Returns the list of all sources of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | List of sources.
|
401 | Not authorized. |
500 | Error.
|
Returns the properties of a specific source.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Source properties.
|
401 | Not authorized. |
500 | Error.
|
Returns the list of all destinations of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | List of destinations.
|
401 | Not authorized. |
500 | Error.
|
Returns the properties of a specific destination.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
destinationId * integer (path) | Destination ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | destination properties.
|
401 | Not authorized. |
500 | Error.
|
Returns the list of playlists.
Parameters
Name | Description |
---|---|
token * string (header) | Security token |
Responses
Code | Description |
200 | destination properties.
|
401 | Not authorized. |
500 | Error.
|
Creates a new Session
Parameters
Name | Description |
---|---|
session * object (body) | New session parameters
|
token * string (header) | Security token |
Responses
Code | Description |
200 | New session properties
|
401 | Not authorized. |
500 | Error.
|
Creates a new source in the given Session
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
source * object (body) | New source parameters
|
token * string (header) | Security token |
Responses
Code | Description |
200 | New source properties
|
401 | Not authorized. |
500 | Error.
|
Creates a new destination in the given Session
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
destination * object (body) | New destination parameters
|
token * string (header) | Security token |
Responses
Code | Description |
200 | New destination properties
|
401 | Not authorized. |
500 | Error.
|
Changes the Session parameters
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
session * object (body) | Session parameters.
|
token * string (header) | Security token |
Responses
Code | Description |
200 | Session properties.
|
401 | Not authorized. |
500 | Error.
|
Execute PLAY action of a specific Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Session was started. |
401 | Not authorized. |
500 | Error.
|
Execute STOP action of a specific Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Session was stopped. |
401 | Not authorized. |
500 | Error.
|
Change source parameters.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
source * object (body) | Source parameters
|
token * string (header) | Security token |
Responses
Code | Description |
200 | Source properties.
|
401 | Not authorized. |
500 | Error.
|
Execute PLAY action of a specific source of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Source was started. |
401 | Not authorized. |
500 | Error.
|
Execute STOP action of a specific source of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Source was stopped. |
401 | Not authorized. |
500 | Error.
|
Execute PAUSE action of a specific source of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Source was paused. |
401 | Not authorized. |
500 | Error.
|
Execute NEXT action of a specific source of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Next action was executed. |
401 | Not authorized. |
500 | Error.
|
Execute PREV action of a specific source of the given Session.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
sourceId * integer (path) | Source ID |
token * string (header) | Security token |
Responses
Code | Description |
200 | Prev action was executed. |
401 | Not authorized. |
500 | Error.
|
Change destination parameters.
Parameters
Name | Description |
---|---|
sessionId * integer (path) | Session ID |
destinationId * integer (path) | Destination ID |
destination * object (body) | Destination parameters
|
token * string (header) | Security token |
Responses
Code | Description |
200 | Destination properties.
|
401 | Not authorized. |
500 | Error.
|