Schedule API

{ "swagger": "2.0", "info": { "version": "2.4.0", "title": "Eagle Eye CameraManager API", "description": "RESTful API for the Eagle Eye CameraManager platform." }, "host": "rest.cameramanager.com", "schemes": [ "http", "https" ], "basePath": "/rest/v2.4", "produces": [ "application/json" ], "definitions": { "Error": { "type": "object", "description": "Generic error response, modelled after RFC 7807.", "properties": { "code": { "type": "integer", "description": "Error code within the system." }, "title": { "type": "string", "description": "This title is not meant to be shown to users and is not guaranteed to stay the same. Please use the code to parse the error." }, "detail": { "type": "string", "description": "Error details, to help developers detect what went wrong." } }, "required": [ "code", "title" ] }, "OAuth2Error": { "type": "object", "description": "Generic OAuth2 error response when there is something wrong with the OAuth2 authentication. Defined at RFC 6749.", "properties": { "error": { "type": "string", "description": "A single ASCII error code conforming the pattern." }, "error_description": { "type": "string", "description": "Human-readable ASCII text providing additional information, used to assist the client developer in understanding the error that occurred." } }, "required": [ "error" ] }, "Intervals": { "type": "object", "description": "Interval of a schedule", "properties": { "start": { "type": "string", "pattern": "^T(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$", "description": "Starting point of the interval. It should be in the range of T00:00:00 to T23:59:59 since this is the range for a day" }, "end": { "type": "string", "pattern": "^T(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$", "description": "End point of the interval. It should be in the range of T00:00:00 to T23:59:59 since this is the range for the day" } }, "required": [ "start", "end" ] }, "TriggerSpecificSchedule": { "type": "object", "description": "It signifies schedule of each trigger type", "properties": { "triggerType": { "type": "string", "description": "It is a trigger type of a schedule. basedOnRecordingMode means that the exact trigger is specified using the recording mode as configured using the /cameras/{cameraId}/mode API.", "enum": [ "pir", "audio", "motion", "analyticsObjectDetection", "analyticsPersonDetection", "basedOnRecordingMode" ] }, "intervalList": { "type": "array", "items": { "$ref": "#/definitions/Intervals" } } }, "required": [ "triggerType", "intervalList" ] }, "ScheduleCreate": { "type": "object", "description": "It signifies a week long camera schedule", "properties": { "sunday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } }, "monday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } }, "tuesday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } }, "wednesday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } }, "thursday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } }, "friday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } }, "saturday": { "type": "array", "items": { "$ref": "#/definitions/TriggerSpecificSchedule" } } }, "required": [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ] }, "Schedule": { "allOf": [ { "type": "object", "properties": { "cameraId": { "type": "integer", "description": "Unique identifier of camera" }, "timeZone": { "type": "string", "description": "The time zone name the account is located in (e.g. Europe/Amsterdam ) according to the TZ database https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" } }, "required": [ "cameraId" ] }, { "$ref": "#/definitions/ScheduleCreate" } ] } }, "parameters": { "cameraId": { "name": "cameraId", "in": "path", "description": "ID of the camera.", "required": true, "type": "integer" } }, "responses": { "resourceNotFound": { "description": "Referenced resource could not be found.", "schema": { "$ref": "#/definitions/Error" } }, "unauthorized": { "description": "You are not authenticated. Please authenticate and try again.", "schema": { "$ref": "#/definitions/OAuth2Error" } }, "forbidden": { "description": "You have no permission to access the specified resource.", "schema": { "$ref": "#/definitions/Error" } }, "validationError": { "description": "The supplied object is invalid. Error detail will contain the validation error.", "schema": { "$ref": "#/definitions/Error" } }, "notAcceptableError": { "description": "The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.", "schema": { "$ref": "#/definitions/Error" } }, "internalServerError": { "description": "Something went wrong in the server. Please try again.", "schema": { "$ref": "#/definitions/Error" } }, "conflict": { "description": "There was a conflict while trying to perform your request. See error details for more information." } }, "paths": { "/cameras/{cameraId}/schedules/recording": { "get": { "summary": "Get week-long camera reocording schedule", "description": "Retrieves a week long list of camera recording schedules that user has access to. Each day of the week contains the list of triggers. Each trigger schedule in turn will contain the trigger type and the list of intervals for that trigger type", "operationId": "getRecordingSchedule", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Schedule" } }, "401": { "$ref": "#/responses/unauthorized" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Schedule" ] }, "put": { "summary": "save week-long camera recording schedule", "description": "Saves week long recording schedule of camera that user has access to. Each day of the week contains the list of triggers. Each trigger schedule in turn will contain the trigger type and the list of intervals for that trigger type", "operationId": "setRecordingSchedule", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "schedule", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ScheduleCreate" } } ], "consumes": [ "application/json" ], "responses": { "201": { "description": "Created" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Schedule" ] } }, "/users/self/schedules/mailNotifications/cameras/{cameraId}": { "get": { "summary": "Get week-long mail notification schedule", "description": "Retrieves a week long list of mail notification schedules that user has access to. Each day of the week contains the list of triggers. Each trigger schedule in turn will contain the trigger type and the list of intervals for that trigger type", "operationId": "getMailNotificationSchedule", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Schedule" } }, "401": { "$ref": "#/responses/unauthorized" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Schedule" ] }, "put": { "summary": "save week-long mail notification schedule", "description": "Saves week long mail notification schedule of camera that user has access to. Each day of the week contains the list of triggers. Each trigger schedule in turn will contain the trigger type and the list of intervals for that trigger type", "operationId": "setMailNotificationSchedule", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "schedule", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ScheduleCreate" } } ], "responses": { "201": { "description": "Created" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Schedule" ] } }, "/users/self/schedules/pushNotifications/cameras/{cameraId}": { "get": { "summary": "Get week-long push notification schedule", "description": "Retrieves a week long list of push notification schedules that user has access to. Each day of the week contains the list of triggers. Each trigger schedule in turn will contain the trigger type and the list of intervals for that trigger type", "operationId": "getPushNotificationSchedule", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Schedule" } }, "401": { "$ref": "#/responses/unauthorized" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Schedule" ] }, "put": { "summary": "save week-long push notification schedule", "description": "Saves week long push notification schedule of camera that user has access to. Each day of the week contains the list of triggers. Each trigger schedule in turn will contain the trigger type and the list of intervals for that trigger type", "operationId": "setPushNotificationSchedule", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "schedule", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ScheduleCreate" } } ], "responses": { "201": { "description": "Created" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Schedule" ] } } } }

swagger-scheduling.yaml