2N® IP Audio Manager HTTP REST API Manual

{ "swagger": "2.0", "info": { "version": "v1", "title": "2N® IP Audio Manager REST HTTP API", "description": "## Info\nSimple description of HTTP REST API for IP Audio Manager control. File can be viewed using http://editor.swagger.io/\n\n\n## Address\nUrl API is versioned, using https, url looks like folowing: `https://server_address/api/v1/endpoint`, where \n* `server_address` – ip address of server\n* `endpoint` – description in Paths sections.\n\n## HTTP\nThe following HTTP command set is used for server communication:\n* `GET` – list of objects \n* `PUT` – object parameter change\n* `POST` – object creation or action assignment\n* `DELETE` – object deletion\n\n\n## Data structure\n### Server request\nStructure of request:\n```json\n{\n \"data\": ...\n}\n```\nEvery 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.\n\n\n### Server response\nResponse structure:\n```json\n{\n \"data\": ...\n}\n```\nEverey response is packed in \"data\" object. \n```json\n{\n \"meta\": \n {\n \"code\": 200\n },\n \"data\": ...,\n \"pagination\": \n {\n \"next_url\": \"...\",\n \"next_max_id\": \"13872296\"\n }\n }\n```\n### Errors\n* `401` – not authtorized (user is not logged in)\n* `403` – no rights (logged user has insufficient rights for this operation)\n* `500 and more` – errors\n\nStructure looks like folowing:\n```json\n{\n \"data\": {\n number:123456\n messagge:\"example\"\n }\n}\n```\n* `messagge` – detailed description of the error \n* `number` – error number (can be used in client for viewing localized description to user)\n\n## Authentization\n\nAuthentication 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`.\n\n## Version Number and Tags\n" }, "basePath": "/api/v1", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ { "name": "not implmented", "description": "Not implemented on the server." }, { "name": "user", "description": "Objects for authorization and user settings." }, { "name": "scheduler", "description": "Objects for controling the scheduler." }, { "name": "session", "description": "Object for controling sessions." } ], "paths": { "/login": { "put": { "tags": [ "user" ], "description": "User login.", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true }, { "in": "body", "name": "user", "required": true, "schema": { "$ref": "#/definitions/login" } } ], "responses": { "200": { "description": "Returns user settings", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/logout": { "put": { "tags": [ "user" ], "description": "User logout.", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "User was logged out." }, "401": { "description": "Not authorized." } } } }, "/account/user": { "get": { "tags": [ "user" ], "description": "Returns user settings.", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Returns user settings.", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "user" ], "description": "Change user settings.", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true }, { "in": "body", "name": "user", "required": true, "schema": { "$ref": "#/definitions/login" } } ], "responses": { "200": { "description": "Returns user settings.", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/calendar/monthly/{year}/{month}": { "get": { "tags": [ "scheduler" ], "description": "Returns day plans in month.", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true }, { "in": "path", "name": "year", "description": "rok", "required": true, "type": "string" }, { "in": "path", "name": "month", "description": "mesic", "required": true, "type": "string" } ], "responses": { "200": { "description": "Array of day events.", "schema": { "type": "array", "items": { "$ref": "#/definitions/dayEventMonthly" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/calendar/weekly/{year}/{week}": { "get": { "tags": [ "scheduler" ], "description": "Returns array of day plans events in a week.", "parameters": [ { "in": "path", "name": "year", "description": "year", "required": true, "type": "string" }, { "in": "path", "name": "week", "description": "week", "required": true, "type": "string" } ], "responses": { "200": { "description": "Array of day plans events.", "schema": { "type": "array", "items": { "$ref": "#/definitions/dayEventWeekly" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans": { "get": { "tags": [ "scheduler" ], "description": "Returns day plans.", "responses": { "200": { "description": "Array of day plans.", "schema": { "type": "array", "items": { "$ref": "#/definitions/dayPlan" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "scheduler" ], "description": "Creates day plan.", "parameters": [ { "in": "body", "name": "name", "description": "Day plan name.", "required": true, "schema": { "$ref": "#/definitions/dayPlanBase" } } ], "responses": { "200": { "description": "Day plan crated, returns its details.", "schema": { "$ref": "#/definitions/dayPlan" } }, "401": { "description": "Neautorizován." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/{dayplanId}": { "get": { "tags": [ "scheduler" ], "description": "Returns detail of day plan.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Detail of day plan.", "schema": { "$ref": "#/definitions/dayPlan" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "scheduler" ], "description": "Change day plan settings.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "body", "name": "dayPlan", "description": "plan", "schema": { "$ref": "#/definitions/dayPlanBase" } } ], "responses": { "200": { "description": "Day plan changed, returns its detail.", "schema": { "$ref": "#/definitions/dayPlan" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "scheduler" ], "description": "Delete day plan.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Day plan deleted.", "schema": { "type": "null" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/{dayplanId}/destinations": { "get": { "tags": [ "scheduler" ], "description": "Returns day plan destinations.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Returns day plan destinations.", "schema": { "type": "array", "items": { "$ref": "#/definitions/destination" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "scheduler" ], "description": "Insert destinations to day plan.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "body", "name": "destinations", "description": "List of inserted destinations.", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/destination" } } } ], "responses": { "200": { "description": "Destinations inserted, returns list of day plan destinations.", "schema": { "type": "array", "items": { "$ref": "#/definitions/destination" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "scheduler" ], "description": "Remove destinations from day plan.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "body", "name": "destinations", "description": "List of removed destinations.", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/destination" } } } ], "responses": { "200": { "description": "Destinations removed, returns list of day plan destinations.", "schema": { "type": "array", "items": { "$ref": "#/definitions/destination" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/{dayplanId}/exceptions": { "get": { "tags": [ "scheduler" ], "description": "Returns day plan exceptions.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Array of day plan destinations.", "schema": { "type": "array", "items": { "$ref": "#/definitions/exception" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "scheduler" ], "description": "Creates day plan exception.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "body", "name": "exception", "description": "Exception.", "required": true, "schema": { "$ref": "#/definitions/exception" } } ], "responses": { "200": { "description": "Excepion created, returns its detail.", "schema": { "$ref": "#/definitions/exception" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/{dayplanId}/exceptions/{exceptionId}": { "get": { "tags": [ "scheduler" ], "description": "Returns detail of day plan exception.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "path", "name": "exceptionId", "description": "Exception id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Detail of day plan exception.", "schema": { "$ref": "#/definitions/exception" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "scheduler" ], "description": "Change day plan exception settings.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "path", "name": "exceptionId", "description": "Exception Id.", "required": true, "type": "string" }, { "in": "body", "name": "exception", "description": "Exception.", "required": true, "schema": { "$ref": "#/definitions/exception" } } ], "responses": { "200": { "description": "Exception changed, returns its detail.", "schema": { "$ref": "#/definitions/exception" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "scheduler" ], "description": "Delete day plan exception.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "path", "name": "exceptionId", "description": "Exception Id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Day plan exception deleted.", "schema": { "type": "null" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/{dayplanId}/records": { "get": { "tags": [ "scheduler" ], "description": "Returns day plan records.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" } ], "responses": { "200": { "description": "Array of day plan records.", "schema": { "type": "array", "items": { "$ref": "#/definitions/record" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "scheduler" ], "description": "Creates record in day plan.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id", "required": true, "type": "string" }, { "in": "body", "name": "settings", "description": "Record settings", "required": true, "schema": { "$ref": "#/definitions/record" } } ], "responses": { "200": { "description": "Record created, returns its detail.", "schema": { "$ref": "#/definitions/record" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/{dayplanId}/records/{recordId}": { "get": { "tags": [ "scheduler" ], "description": "Returns detail of day plan record.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "path", "name": "recordId", "description": "Record id", "required": true, "type": "string" } ], "responses": { "200": { "description": "Detail of day plan record.", "schema": { "$ref": "#/definitions/record" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "scheduler" ], "description": "Chenge day plan record.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "path", "name": "recordId", "description": "Record id", "required": true, "type": "string" } ], "responses": { "200": { "description": "Record changes, returns its detail.", "schema": { "$ref": "#/definitions/record" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "scheduler" ], "description": "Delete day plan record.", "parameters": [ { "in": "path", "name": "dayplanId", "description": "Day plan id.", "required": true, "type": "string" }, { "in": "path", "name": "recordId", "description": "Record id", "required": true, "type": "string" } ], "responses": { "200": { "description": "Day plan record deleted.", "schema": { "type": "null" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/dayplans/commands": { "get": { "tags": [ "scheduler" ], "description": "Returns list of possible commands.", "responses": { "200": { "description": "List of commands.", "schema": { "type": "array", "items": { "$ref": "#/definitions/dayPlanCommand" } } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/destinations/treeStructure": { "get": { "tags": [ "scheduler", "session" ], "description": "Returns list of zones. Zones are located in a tree, there can be another zone in zone.", "responses": { "200": { "description": "List of zones.", "schema": { "$ref": "#/definitions/zone" } }, "401": { "description": "Not authorized." }, "403": { "description": "Insufficent rights." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/holidays": { "get": { "tags": [ "scheduler" ], "description": "Returns list of holidays.", "responses": { "200": { "description": "List of holidays.", "schema": { "type": "array", "items": { "$ref": "#/definitions/holiday" } } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "scheduler" ], "description": "Create holiday.", "parameters": [ { "in": "body", "name": "createHoliday", "description": "Holiday settings", "required": true, "schema": { "$ref": "#/definitions/holiday" } } ], "responses": { "200": { "description": "Create new holiday.", "schema": { "$ref": "#/definitions/holiday" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/holidays/{holidayId}": { "get": { "tags": [ "scheduler" ], "description": "Returns detail of holiday.", "parameters": [ { "in": "path", "name": "holidayId", "description": "Holiday id", "required": true, "type": "integer" } ], "responses": { "200": { "description": "Detail of holiday.", "schema": { "$ref": "#/definitions/holiday" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "description": "Change holiday settings.", "tags": [ "scheduler" ], "parameters": [ { "in": "path", "name": "holidayId", "description": "Holiday id", "required": true, "type": "integer" }, { "in": "body", "name": "editHoliday", "required": true, "schema": { "$ref": "#/definitions/holiday" } } ], "responses": { "200": { "description": "Holiday changed, return its detail.", "schema": { "$ref": "#/definitions/holiday" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "scheduler" ], "description": "Delete holiday.", "parameters": [ { "in": "path", "type": "integer", "name": "holidayId", "description": "Holiday id.", "required": true } ], "responses": { "200": { "description": "Holiday deleted.", "schema": { "type": "null" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions": { "get": { "tags": [ "session" ], "description": "Returns the list of all Sessions", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "List of Sessions.", "schema": { "type": "array", "items": { "$ref": "#/definitions/session" } } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "session" ], "description": "Creates a new Session", "parameters": [ { "in": "body", "name": "session", "description": "New session parameters", "required": true, "schema": { "$ref": "#/definitions/session" } }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "New session properties", "schema": { "$ref": "#/definitions/session" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}": { "get": { "tags": [ "session" ], "description": "Returns properties of a specific Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Session properties.", "schema": { "$ref": "#/definitions/session" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "session" ], "description": "Changes the Session parameters", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "body", "name": "session", "description": "Session parameters.", "required": true, "schema": { "$ref": "#/definitions/session" } }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Session properties.", "schema": { "$ref": "#/definitions/session" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "session" ], "description": "Delete session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Session was deleted." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/play": { "put": { "tags": [ "session" ], "description": "Execute PLAY action of a specific Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Session was started." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/stop": { "put": { "tags": [ "session" ], "description": "Execute STOP action of a specific Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Session was stopped." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources": { "get": { "tags": [ "session" ], "description": "Returns the list of all sources of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "List of sources.", "schema": { "type": "array", "items": { "$ref": "#/definitions/session_source" } } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "session" ], "description": "Creates a new source in the given Session", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "body", "name": "source", "description": "New source parameters", "required": true, "schema": { "$ref": "#/definitions/session_source" } }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "New source properties", "schema": { "$ref": "#/definitions/session_source" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources/{sourceId}": { "get": { "tags": [ "session" ], "description": "Returns the properties of a specific source.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Source properties.", "schema": { "$ref": "#/definitions/session_source" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "session" ], "description": "Change source parameters.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "body", "name": "source", "description": "Source parameters", "required": true, "schema": { "$ref": "#/definitions/session_source" } }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Source properties.", "schema": { "$ref": "#/definitions/session_source" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "session" ], "description": "Delete session source.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Source was deleted." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources/{sourceId}/play": { "put": { "tags": [ "session" ], "description": "Execute PLAY action of a specific source of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Source was started." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources/{sourceId}/stop": { "put": { "tags": [ "session" ], "description": "Execute STOP action of a specific source of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Source was stopped." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources/{sourceId}/pause": { "put": { "tags": [ "session" ], "description": "Execute PAUSE action of a specific source of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Source was paused." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources/{sourceId}/next": { "put": { "tags": [ "session" ], "description": "Execute NEXT action of a specific source of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Next action was executed." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/sources/{sourceId}/prev": { "put": { "tags": [ "session" ], "description": "Execute PREV action of a specific source of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "sourceId", "description": "Source ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Prev action was executed." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/destinations": { "get": { "tags": [ "session" ], "description": "Returns the list of all destinations of the given Session.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "List of destinations.", "schema": { "type": "array", "items": { "$ref": "#/definitions/session_dest" } } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "post": { "tags": [ "session" ], "description": "Creates a new destination in the given Session", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "body", "name": "destination", "description": "New destination parameters", "required": true, "schema": { "$ref": "#/definitions/session_dest" } }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "New destination properties", "schema": { "$ref": "#/definitions/session_dest" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/sessions/{sessionId}/destinations/{destinationId}": { "get": { "tags": [ "session" ], "description": "Returns the properties of a specific destination.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "destinationId", "description": "Destination ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "destination properties.", "schema": { "$ref": "#/definitions/session_dest" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "put": { "tags": [ "session" ], "description": "Change destination parameters.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "destinationId", "description": "Destination ID", "required": true, "type": "integer" }, { "in": "body", "name": "destination", "description": "Destination parameters", "required": true, "schema": { "$ref": "#/definitions/session_dest" } }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Destination properties.", "schema": { "$ref": "#/definitions/session_dest" } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } }, "delete": { "tags": [ "session" ], "description": "Delete session destination.", "parameters": [ { "in": "path", "name": "sessionId", "description": "Session ID", "required": true, "type": "integer" }, { "in": "path", "name": "destinationId", "description": "Destination ID", "required": true, "type": "integer" }, { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "Destination was deleted." }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } }, "/playlists": { "get": { "tags": [ "session" ], "description": "Returns the list of playlists.", "parameters": [ { "in": "header", "name": "token", "description": "Security token", "type": "string", "required": true } ], "responses": { "200": { "description": "destination properties.", "schema": { "type": "array", "items": { "$ref": "#/definitions/source_item" } } }, "401": { "description": "Not authorized." }, "500": { "description": "Error.", "schema": { "$ref": "#/definitions/error" } } } } } }, "definitions": { "error": { "type": "object", "properties": { "messagge": { "type": "string", "description": "Description of an error." }, "number": { "type": "string", "description": "Unique error identificator." } } }, "dayEventMonthly": { "type": "object", "properties": { "date": { "type": "integer", "description": "Dat of this object." }, "dayPlans": { "type": "array", "items": { "$ref": "#/definitions/dayPlanCal" } } } }, "dayEventWeeklyItem": { "type": "object", "properties": { "record": { "$ref": "#/definitions/record" }, "day_plan": { "$ref": "#/definitions/dayPlanCal" } } }, "dayEventWeekly": { "type": "object", "properties": { "date": { "type": "string", "description": "Date of this day event." }, "items": { "type": "array", "items": { "$ref": "#/definitions/dayEventWeeklyItem" } } } }, "dayPlan": { "type": "object", "properties": { "id": { "type": "integer", "description": "Day plan Id. Read only." }, "name": { "type": "string", "description": "Day plan name." }, "color": { "type": "integer", "description": "Index of day plan color." }, "priority": { "type": "integer", "description": "Session priority." }, "repeater": { "$ref": "#/definitions/repeater" }, "records": { "type": "array", "items": { "$ref": "#/definitions/record" } }, "destinations": { "type": "array", "items": { "$ref": "#/definitions/destination" } }, "exceptions": { "type": "array", "items": { "$ref": "#/definitions/exception" } } } }, "dayPlanCal": { "type": "object", "required": [ "name" ], "properties": { "id": { "type": "integer", "description": "Day plan Id. Read only." }, "name": { "type": "string", "description": "Day plan name. Required in POST only." }, "color": { "type": "integer", "description": "Index of day plan color." }, "priority": { "type": "integer", "description": "Session priority." }, "exception": { "type": "integer", "description": "This day plan is / is not present in calendar because of an exception.\n<ul>\n<li>0 - Day plan is not present because of an exception.\n<li>1 - Day plan has negative exception.\n<li>2 - Day plan has positive exception.\n" } } }, "dayPlanBase": { "type": "object", "required": [ "name" ], "properties": { "id": { "type": "integer", "description": "Day plan Id. Read only." }, "name": { "type": "string", "description": "Day plan name. Required in POST only." }, "color": { "type": "integer", "description": "Index of day plan color." }, "priority": { "type": "integer", "description": "Session priority." }, "repeater": { "$ref": "#/definitions/repeater" } } }, "login": { "type": "object", "required": [ "login", "password" ], "properties": { "login": { "type": "string", "description": "User name." }, "password": { "type": "string", "description": "User password." } } }, "session": { "type": "object", "properties": { "id": { "type": "integer", "description": "Session ID. Read only." }, "name": { "type": "string", "description": "Name" }, "volume": { "type": "integer", "description": "Output volume ranging from 0 to 4096." }, "balance": { "type": "integer", "description": "Output balance ranging from -100 to 100." }, "fade_time": { "type": "integer", "description": "When changing balance or volume, this timeout is used." }, "active": { "type": "boolean", "description": "Indicates that the Session is active." }, "muted": { "type": "boolean", "description": "Indicates that the Session is muted." }, "priority": { "type": "integer", "description": "Priority of the Session output stream." }, "channel": { "type": "integer", "description": "Channel - for stream selection on IP Audio Manager" }, "state": { "type": "string", "description": "Session state - one of ACTIVE, OPENING, CLOSING, IDLE or ERROR. Read only." }, "sources": { "type": "array", "description": "Sources assigned to the Session. Read only.", "items": { "$ref": "#/definitions/session_source" } }, "destinations": { "type": "array", "description": "Destinations assigned to the Session. Read only.", "items": { "$ref": "#/definitions/session_dest" } } } }, "session_source": { "type": "object", "properties": { "source_id": { "type": "integer", "description": "Session source ID. Read only." }, "session_id": { "type": "integer", "description": "Session ID. Read only." }, "name": { "type": "string", "description": "Session source name. Read only." }, "type": { "type": "string", "description": "Source type, one of HW, PLAY_LIST, RADIO, MIKE, USER, FREE_RIDE, VIRTUAL_INPUT, PORT, GEN_VIEW, COMMON_SRC, SPEAKER, UNKNOWN." }, "id": { "type": "integer", "description": "Source ID from table according to type" }, "volume": { "type": "integer", "description": "Output volume ranging from 0 to 4096." }, "balance": { "type": "integer", "description": "Output balance ranging from -100 to 100." }, "fade_time": { "type": "integer", "description": "When changing balance or volume, this timeout is used." }, "active": { "type": "boolean", "description": "Indicates that the Session source is active." }, "muted": { "type": "boolean", "description": "Indicates that the Session source is muted." }, "shuffle": { "type": "boolean", "description": "Indicates that the Session source has shuffle enabled. (Used for playlists.)" }, "repeat": { "type": "boolean", "description": "Indicates that the Session source has repeat enabled. (Used for playlists.)" }, "state": { "type": "string", "description": "Source state. One of ACTIVE, OPENING, CLOSING, IDLE or ERROR. Read only." }, "play_state": { "type": "string", "description": "Play state, One of READING, PLAYING, PAUSED or STOPPED. Read only." } } }, "session_dest": { "type": "object", "properties": { "dest_id": { "type": "integer", "description": "Session destination ID. Read only." }, "session_id": { "type": "integer", "description": "Session ID. Read only." }, "name": { "type": "string", "description": "Session destination name. Read only." }, "type": { "type": "string", "description": "Source type, one of SPEAKER, MIKE, GROUP, LOCAL_HW, COMMON_DST, HTTP." }, "id": { "type": "integer", "description": "Destination ID from table according to type." }, "active": { "type": "boolean", "description": "Indicates that the Session destination is active." }, "state": { "type": "string", "description": "Source state. One of ACTIVE, OPENING, CLOSING, IDLE or ERROR. Read only." } } }, "user": { "type": "object", "properties": { "localization": { "type": "integer" }, "show_weekends": { "type": "boolean" }, "name": { "type": "string", "description": "Username. Read only." }, "sunday_first": { "type": "boolean", "description": "Is sunday first day of week? Read only." } } }, "destination": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "type": "integer", "description": "Destination type\n<ul>\n<li>0 - Speaker, dest_id is speaker id.\n<li>1 - Zone, dest_id is zone id.\n<li>2 - Local hardware, dest_id is local hardware id.\n<li>3 - Rtp, dest_id is Rtp id.\n<li>4 - Mike, dest_id is Mike id.\n<li>5 - Http, dest_id is Http id. Not yet implemented.\n" }, "id": { "type": "integer", "description": "Destination id according to destination type." }, "name": { "type": "string", "description": "Name of destination. Read only." } } }, "zoneInner": { "type": "object", "properties": { "id": { "type": "integer", "description": "Zone id." }, "name": { "type": "string", "description": "Zone name." } } }, "zone": { "type": "object", "properties": { "id": { "type": "integer", "description": "Speaker id." }, "name": { "type": "string", "description": "Speaker name." }, "zones": { "type": "array", "items": { "$ref": "#/definitions/zoneInner" }, "description": "Inner zones for this zone. Part of this object can be other zones. Insted of zoneInner there should be zone again, but the documentation systems does'nt alow recursive structure." }, "destinations": { "type": "array", "items": { "$ref": "#/definitions/destination" }, "description": "All destinations, which belongs to zone." } } }, "exception": { "type": "object", "properties": { "id": { "type": "integer", "description": "Exception ID. Read only." }, "day": { "type": "integer", "description": "Day of month. (1-31)." }, "month": { "type": "integer", "description": "Month in year. (1-12)." }, "year": { "type": "integer", "description": "Year. When the year is 0, exception occures every year. Year must be 0 or between 1900 and 3000." }, "is_negative": { "type": "boolean", "description": "Exception is negative. In this day the events will not occure, even if it's planed." } } }, "holiday": { "type": "object", "properties": { "id": { "type": "integer", "description": "Holiday id. Read only." }, "day": { "type": "integer" }, "month": { "type": "integer" }, "year": { "type": "integer", "description": "When the year is 0, holiday occures every year. Year must be 0 or between 1900 and 2035." } } }, "dayPlanCommand": { "type": "object", "properties": { "type": { "type": "integer", "description": "Type of command\n<ul>\n<li>0 Start play the play list. Par is play list id.\n<li>1 Run HTTP command. Par is HTTP id.\n" }, "par": { "type": "integer", "description": "Command parametr. Description in type." }, "name": { "type": "string", "description": "Name of http command ir playlist. Read only." } } }, "source_item": { "type": "object", "properties": { "id": { "type": "integer", "description": "Id of source item. Read only." }, "name": { "type": "string", "description": "Name of source item. Read only." } } }, "record": { "type": "object", "properties": { "id": { "type": "integer", "description": "Record id. Read only." }, "time_hour": { "type": "integer", "description": "Hour of this event." }, "time_min": { "type": "integer", "description": "Minute of this event." }, "command": { "$ref": "#/definitions/dayPlanCommand" } } }, "repeater": { "type": "object", "properties": { "day_type": { "type": "integer", "description": "Day type how to plan an event\n<ul>\n<li>0 - Event occeres every day.\n<li>1 - Event occeres only in specific day of the week. Day_par is an array of days in week, when the event occures (0 is monday, 6 is sunday, 7 is holiday)\n<li>2 - Event occures only x-th day of the month. Day_par is x.\n" }, "day_par": { "type": "integer", "description": "Parameter for day planning. Description in day_type." }, "week_type": { "type": "integer", "description": "Week type how to plan an event\n<ul>\n<li>0 - Never occures. The evnet occures only in positive exceptions.\n<li>1 - The event occures every week.\n<li>2 - The event occures only in odd week (0) or only in even week (1) according to the week_par.\n<li>3 - The event occures every x-th week of the month. Week_par is an array of numbers. (0 is first week, 1 is second week etc.)\n" }, "week_par": { "type": "integer", "description": "Parameter for week planning. Description in week_type." }, "interval_type": { "type": "integer", "description": "Interval when event is active.\n<ul>\n<li>0 - The event takes place infinitely.\n<li>1 - The event ends in specific date. End_date is a date, when the event ends.\n<li>2 - The event ends after x occurences. Number of occurences is located in counter parameter. Exceptions are ignored. There is a date of end in end_date parameter for infomration.\n" }, "start_date": { "type": "string", "description": "Date of beggining of day plan. Minimum year is 1601." }, "end_date": { "type": "string", "description": "End date of day plan. Minimum year is 1601. Only when type_interval==1. When type_interval==2, there is an date of ending for information" }, "counter": { "type": "integer", "description": "Number of occurences. Only when type_interval==2." } } } } }