openapi: 3.0.0 info: title: AMAVM VDH API description: | AMAVM VDH API version: 1.0.9999 servers: - url: 'http://localhost:3000' description: Localhost execution - url: 'https://ohp6vrr7xd.execute-api.ca-central-1.amazonaws.com/dev' description: Dev environment tags: - name: Api description: Operations related to general API operations - name: Bicycle Paths description: Operations related to Bicycle - name: Observations description: Operations related to observations paths: /info: get: summary: 'Get general api information, like the exact version.' tags: - Api responses: '200': description: The Api information headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: type: object description: Information about the API. required: - name - environment - version properties: name: type: string description: The name of the API. environment: type: string description: The name of the environment. version: type: string description: > The exact version of the deployed api. Recommendation is to follow the SemVer 2.0 specification (http://semver.org/) timestamp: type: string format: date-time description: The last deployment date and time 5XX: $ref: '#/components/responses/internalServerError' /api/health: get: summary: Get health and self-diagnostic information. tags: - Api responses: '200': description: The system is healthy. headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' '400': description: The system is healthy. headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' 5XX: description: The health checks failed. headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' /api/v1/bicycle-paths: get: summary: Retrieve the list of bicycle paths tags: - Bicycle Paths parameters: - name: bbox description: | The bounding box to restrict for position. Submit 4 numbers: - South West latitude, - South West longitude, - North East latitude, - North East longitude in: query schema: type: array items: type: number minimum: 4 maximum: 4 style: form explode: false - name: borough description: The name of the borough to restrict it to in: query schema: type: string - name: limit description: The number of elements to return in one shot. in: query schema: type: integer minimum: 1 - name: near description: A single coordinate to indicate center position in: query schema: type: array items: type: number minimum: 2 maximum: 2 style: form explode: false - name: network description: The network that the path belongs to in: query schema: $ref: '#/components/schemas/BicyclePathNetwork' - name: nextToken description: The continuation token for next results in: query schema: type: string - name: numberofLanes description: The number of lanes in: query schema: type: integer - name: type description: The type of bicycle path in: query schema: $ref: '#/components/schemas/BicyclePathType' responses: '200': description: The list of bicycle paths headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: type: object properties: items: type: array items: $ref: '#/components/schemas/BicyclePath' nextToken: type: string required: - items 5XX: $ref: '#/components/responses/internalServerError' /api/v1/observations: get: summary: Get a list of observations tags: - Observations parameters: - name: endTs description: The upper bound for timestamps in Unix Epoch (seconds). in: query schema: type: number - name: sort description: The sort order. in: query schema: $ref: '#/components/schemas/GetObservationsRequestSort' - name: startTs description: The lower bound for timestamps in Unix Epoch (seconds). in: query schema: type: number - name: attributes description: The list of observation attributes to filter the list in: query schema: type: array items: type: string style: form explode: false - name: status description: The list of observation statuses to filter the list in: query schema: type: array items: type: string style: form explode: false - name: nextToken description: The continuation token for next results in: query schema: type: string responses: '200': description: The reported observations headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: type: object properties: items: type: array items: $ref: '#/components/schemas/ReportedObservation' nextToken: type: string required: - items '404': $ref: '#/components/responses/notfound' 5XX: $ref: '#/components/responses/internalServerError' post: summary: Post a new observation about snow removal tags: - Observations requestBody: content: application/json: schema: $ref: '#/components/schemas/ObservationRequest' responses: '201': description: The reported observation headers: Location: schema: type: string x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: $ref: '#/components/schemas/ReportedObservation' '400': $ref: '#/components/responses/badRequest' '404': $ref: '#/components/responses/notfound' 5XX: $ref: '#/components/responses/internalServerError' '/api/v1/observations/{observationId}': get: summary: Get a single observation tags: - Observations parameters: - name: observationId in: path required: true schema: type: string responses: '200': description: The observation headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: $ref: '#/components/schemas/ReportedObservation' '404': $ref: '#/components/responses/notfound' 5XX: $ref: '#/components/responses/internalServerError' delete: summary: Delete an observation tags: - Observations security: - ApiKey: [] parameters: - name: observationId in: path required: true schema: type: string responses: '204': description: The observation was deleted headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notfound' 5XX: $ref: '#/components/responses/internalServerError' '/api/v1/observations/{observationId}/status': put: summary: Update the status of an observation tags: - Observations security: - ApiKey: [] parameters: - name: observationId in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateObservationStatusRequest' responses: '200': description: The updated observation headers: x-amzn-RequestId: $ref: '#/components/headers/x-amzn-RequestId' content: application/json: schema: $ref: '#/components/schemas/ReportedObservation' '403': $ref: '#/components/responses/forbidden' '404': $ref: '#/components/responses/notfound' 5XX: $ref: '#/components/responses/internalServerError' components: securitySchemes: ApiKey: type: apiKey in: header name: x-api-key headers: x-amzn-RequestId: description: The request id that uniquely identifies this request. schema: type: string responses: internalServerError: description: Server error - something went wrong. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' unauthorized: description: > Access has been denied because the user does not have the necessary priviledges to call the endpoint. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' forbidden: description: > Access has been denied because the user does not have the necessary priviledges to call the endpoint. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' notfound: description: The requested item or item to update was not found. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' badRequest: description: The request is invalid. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' schemas: ErrorResponse: type: object description: Standard error response message. required: - error properties: error: $ref: '#/components/schemas/Error' Error: type: object description: Information about an error. required: - code - message properties: code: type: string description: One of a server-defined set of error codes. enum: - internalServerError - notFound - goneError - badRequest - validationError - configurationError - dependencyError message: type: string description: A human-readable representation of the error. target: type: string description: The target of the error. details: type: array items: $ref: '#/components/schemas/Error' description: > An array of details about specific errors that led to this reported error. innererror: $ref: '#/components/schemas/InnerError' InnerError: type: object description: More details about an error. properties: code: type: string description: >- A more specific error code than was provided by the containing error. innererror: type: object description: > An object containing more specific information than the current object about the error. HealthCheckResult: type: object description: Health check result (recursive) required: - name - status - elapsed properties: name: type: string description: The health check name. target: type: string description: 'An indication of the system targeted for the health check, if any.' status: type: string description: The status of the health check enum: - Inconclusive - Ok - Warning - Error error: type: object description: Description of the error that has occured. elapsed: type: number description: The number of milliseconds taken by the health check verification. children: type: array description: 'Sub health checks, if any.' items: $ref: '#/components/schemas/HealthCheckResult' AssetContentType: enum: - image/jpeg - image/png type: string BicyclePath: description: A bicycle path. type: object properties: borough: description: The name of the borough. type: string divider: $ref: '#/components/schemas/BicyclePathDivider' description: The divider type. geometry: description: |- The GeoJson geometry. Be careful - GeoJson Positions are [long, lat, elevation] type: object properties: type: type: string enum: - MultiLineString coordinates: type: array items: type: array items: type: array items: type: number additionalProperties: false required: - coordinates - type id: description: Unique id for the bicycle path type: string length: description: The length in meters type: number numberOfLanes: description: The number of lanes type: number network: $ref: '#/components/schemas/BicyclePathNetwork' description: Which network does this bicycle path belong to. type: $ref: '#/components/schemas/BicyclePathType' description: The type of bicycle path additionalProperties: false required: - borough - divider - geometry - id - length - network - numberOfLanes - type BicyclePathDivider: enum: - cloture - delineateur - jersey - mail - marquage-sol - unknown type: string BicyclePathFeature: type: object properties: properties: type: object properties: {} type: type: string enum: - Feature additionalProperties: false required: - properties - type BicyclePathNetwork: enum: - 3-seasons - 4-seasons - unknown type: string BicyclePathType: enum: - accotement-asphalte - bande-cycleable - chaussee-designee - piste-cyclable-rue - piste-cyclable-site-propre - piste-cyclable-trottoir - sentier-polyvalent - unknown - velorue type: string BicyclePathsRequest: type: object properties: bbox: description: >- The bounding box to restrict bicycle path locations. Parameters are: South West latitude, South West longitude, North East latitude, North East longitude maximum: 4 minimum: 4 type: array items: type: number borough: description: The name of the borough to filter. type: string limit: description: The number of returned elements in one shot. type: number near: maximum: 2 minimum: 2 type: array items: type: number numberOfLanes: description: The number of lanes type: number network: description: Which network does this bicycle path belong to. enum: - 3-seasons - 4-seasons - unknown type: string type: description: The type of bicycle path enum: - accotement-asphalte - bande-cycleable - chaussee-designee - piste-cyclable-rue - piste-cyclable-site-propre - piste-cyclable-trottoir - sentier-polyvalent - unknown - velorue type: string nextToken: description: The next continuation token. type: string additionalProperties: false GeoJSONBicyclePathProperties: type: object properties: numberOfLanes: description: The number of lanes type: number network: description: Which network does this bicycle path belong to. enum: - 3-seasons - 4-seasons - unknown type: string type: description: The type of bicycle path enum: - accotement-asphalte - bande-cycleable - chaussee-designee - piste-cyclable-rue - piste-cyclable-site-propre - piste-cyclable-trottoir - sentier-polyvalent - unknown - velorue type: string additionalProperties: false GetObservationsRequest: type: object properties: attributes: description: The attributes to filter by type: array items: type: string startTs: description: The start timestamp. Unix Epoch in seconds. type: number status: description: The status to filter by type: array items: description: Status for observations enum: - pending - rejected - valid type: string endTs: description: The end timestamp. Unix Epoch in seconds. type: number sort: $ref: '#/components/schemas/GetObservationsRequestSort' description: The sort order. nextToken: description: The next continuation token. type: string additionalProperties: false required: - sort GetObservationsRequestSort: enum: - timestamp-asc - timestamp-desc type: string ObservationAssetBase: type: object properties: contentType: $ref: '#/components/schemas/AssetContentType' description: The asset content-type additionalProperties: false required: - contentType ObservationBase: description: Base definition for observations. type: object properties: attributes: description: Attributes to further characterize the observation. type: array items: type: string comment: description: Free-form comments. type: string deviceId: description: A device identifier (the reporting device). type: string position: description: |- A GeoJSON position for the observation. Be careful - GeoJson Positions are [long, lat, elevation] type: array items: type: number timestamp: description: A timestamp of when the observation was done. Unix Epoch in seconds. type: number additionalProperties: false required: - deviceId - position - timestamp ObservationRequest: description: Request to submit an observation. type: object properties: assets: description: Attached assets. type: array items: $ref: '#/components/schemas/ObservationRequestAsset' attributes: description: Attributes to further characterize the observation. type: array items: type: string comment: description: Free-form comments. type: string deviceId: description: A device identifier (the reporting device). type: string position: description: |- A GeoJSON position for the observation. Be careful - GeoJson Positions are [long, lat, elevation] type: array items: type: number timestamp: description: A timestamp of when the observation was done. Unix Epoch in seconds. type: number additionalProperties: false required: - deviceId - position - timestamp ObservationRequestAsset: description: An asset submitted alongside an ObservationRequest. type: object properties: data: description: Base-64 encoded data. type: string contentType: $ref: '#/components/schemas/AssetContentType' description: The asset content-type additionalProperties: false required: - contentType - data ObservationStatus: description: Status for observations enum: - pending - rejected - valid type: string ReportedObservation: description: A reported observation type: object properties: assets: description: Associated assets. type: array items: $ref: '#/components/schemas/ReportedObservationAsset' id: description: Unique id type: string status: $ref: '#/components/schemas/ObservationStatus' description: The status of the observation. attributes: description: Attributes to further characterize the observation. type: array items: type: string comment: description: Free-form comments. type: string deviceId: description: A device identifier (the reporting device). type: string position: description: |- A GeoJSON position for the observation. Be careful - GeoJson Positions are [long, lat, elevation] type: array items: type: number timestamp: description: A timestamp of when the observation was done. Unix Epoch in seconds. type: number additionalProperties: false required: - deviceId - id - position - status - timestamp ReportedObservationAsset: description: An asset attached alongside a ReportedObservation. type: object properties: url: description: Base-64 encoded data. type: string contentType: $ref: '#/components/schemas/AssetContentType' description: The asset content-type additionalProperties: false required: - contentType - url UpdateObservationStatusRequest: type: object properties: status: $ref: '#/components/schemas/ObservationStatus' additionalProperties: false required: - status