CSUSB Parking Monitor

Monitors capacity for parking structures
More information: csusb.cse.parking@gmail.com
Contact Info: csusb.cse.parking@gmail.com
Version: 1
All rights reserved
http:/apache.org/licenses/LICENSE-2.0.html

Table of Contents

HistoricalData

RealtimeData


HistoricalData

Up
get /api/parking/locations/<location>/bigquery/
query historical data (bigquery)
make a query to google bigquery. Returns a list of dictionaries containing key value pairs. Keys are timestamp, sensor id, event, and description. A request would look like /bigquery?start=2019-06-19&end=2019-09-07&order=ASC

Query parameters

start (required)
Query Parameter — use a date you want to begin your query from. The query must be in format e.g. 2019-09-07 format: date
end (optional)
Query Parameter — use a date you want to begin your query from, default is now. The query must be in . format: date
order (optional)
Query Parameter — order as DESC or ASC. Default is ASC
graph (optional)
Query Parameter — produces a list of dictionaries with keys 'timestamp' and 'count' to use for graphing a running count over time. Set to 'true' or '1'
sensor (optional)
Query Parameter — will filter query by sensor id.

Responses

200

OK

400

Bad Request

RealtimeData

Up
get /api/parking/
Returns all data (apiParkingGet)
returns all information available. Get all locations.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Up
post /api/parking/
create new location (apiParkingPost)
Will add a new a new location to locations/ and the location name to keys/

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

id (required)
Body Parameter — names of new locations. Can either be a single name or a list of names

Query parameters

token (required)
Query Parameter — secret key

Responses

200

OK

400

Missing parameters

401

token is invalid!

403

token is missing!

Up
delete /api/parking/
delete existing location (apiParkingDelete)
Will delete locations from locations/ and keys/ to keys/

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

id (required)
Body Parameter — names of existing locations. Can either be a single name or a list of names

Query parameters

token (required)
Query Parameter — secret key

Responses

200

OK

400

Missing parameters

401

token is invalid!

403

token is missing!

Up
get /api/parking/keys/
retruns location names (apiParkingKeysGet)
returns the names of all parking lots

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Up
get /api/parking/locations/<location>/
get location data (apiParkingLocationslocationGet)
returns all information about a specific location. Can get location name from keys/

Responses

200

OK

400

Location does not exit

Up
put /api/parking/locations/<location>/
update content to location (apiParkingLocationslocationPut)
update content at specific location

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

json (required)
Body Parameter — values to update

Query parameters

token (required)
Query Parameter — secret key

Responses

200

OK

400

body error

401

token is invalid!

403

token is missing!

404

Location does not exit

Up
get /api/parking/schema/
schema for a given location (apiParkingSchemaGet)
returns the default structure for each location

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Up
put /api/parking/schema/
add a new item to schema (apiParkingSchemaPut)
Will add a new a new location to locations/ and the location name to keys/

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

json (required)
Body Parameter — a json object of a new key name and a default value

Query parameters

token (required)
Query Parameter — secret key

Responses

200

OK

400

empty body

401

token is invalid!

403

token is missing!

Up
delete /api/parking/schema/
delete item in schema (apiParkingSchemaDelete)
Will delete an item from schema and in all locations

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

json (required)
Body Parameter — key/keys to delete

Query parameters

token (required)
Query Parameter — secret key

Responses

200

OK

400

empty body

401

token is invalid!

403

token is missing!