An API to query up-to-date arrival times and schedule arrival notifications
Usage: bns <command> [options] command seed-db clear and reinitialize the database clear-db clear the database start-server start the api server gen-static-docs generate docs for the api Options: -v VERBOSITY, --verbosity VERBOSITY verbosity level (trace | debug | info | warn | error | fatal) Environment variables: BART_NOTIFIER_DB_URI - the database uri BART_NOTIFIER_BART_API_KEY - your BART API key BART_NOTIFIER_TWILIO_API_KEY - your twilio API key BART_NOTIFIER_TWILIO_SID - your twilio SID BART_NOTIFIER_TWILIO_NUMBER - your twilio number
- /stations
- /stations/:_id
- /stations/:_id/:id/destinations
- /stations/:_id/:id/arrivals
- /notifications
- /notifications/:id
/stations [↑]
get station information
GET
-- /stations [↑]
Find objects in this Collection.
name | description | required | location | default | schema |
---|---|---|---|---|---|
query | Query spec (JSON) | no | query |
null
|
|
view | View | no | query |
null
|
|
sort | Sort spec (JSON) | no | query |
null
|
|
projection | Projection spec (JSON) | no | query |
null
|
|
skip | Results to skip | no | query |
null
|
|
limit | Results to limit | no | query |
null
|
|
status code | description | headers | schema |
---|---|---|---|
200 | Returns an array of objects. Each object has an _id and possible additional properties. |
null |
|
400 | Request is malformed (i.e. invalid parameters). |
null |
|
403 | User is not authorized to run this operation. |
null |
|
500 | There was an unexpected internal error processing this request. |
null |
|
/stations/:_id [↑]
GET
-- /stations/:_id [↑]
Find an object in this Collection by _id.
name | description | required | location | default | schema |
---|---|---|---|---|---|
_id | Object _id | yes | path |
null
|
null |
view | View | no | query |
null
|
|
status code | description | headers | schema |
---|---|---|---|
200 | Returns the object resource found at this URL specified by id. |
null |
|
400 | Request is malformed (i.e. invalid parameters). |
null |
|
403 | User is not authorized to run this operation. |
null |
|
404 | Collection resource cannot be found by the supplied _id. |
null |
|
500 | There was an unexpected internal error processing this request. |
null |
|
/stations/:_id/:id/destinations [↑]
Per station destinations.
GET
-- /stations/:_id/:id/destinations [↑]
Retrieve a list of valid destinations for a particular station.
name | description | required | location | default | schema |
---|---|---|---|---|---|
_id | Object _id | yes | path |
null
|
null |
id | id | yes | path |
null
|
null |
/stations/:_id/:id/arrivals [↑]
Per station estimated arrival times.
GET
-- /stations/:_id/:id/arrivals [↑]
Retrieve a list of estimated arrival times for a particular station
name | description | required | location | default | schema |
---|---|---|---|---|---|
_id | Object _id | yes | path |
null
|
null |
id | id | yes | path |
null
|
null |
destination | Filter results by destination (e.g., "RICH" for all Richmond bound trains) | no | query |
null
|
|
/notifications [↑]
Arrival notifications.
GET
-- /notifications [↑]
List active arrival notifications.
name | description | required | location | default | schema |
---|---|---|---|---|---|
destination | Filter results by destination. | no | query |
null
|
|
skip | Skip the first N results. | no | query |
0
|
|
limit | Limit the number of results returned. | no | query |
10
|
|
POST
-- /notifications [↑]
Create a new notification.
name | description | required | location | default | schema |
---|---|---|---|---|---|
body | Notification object | yes | body |
null
|
|
DELETE
-- /notifications [↑]
Cancel all active notifications.
/notifications/:id [↑]
Arrival notification details.
GET
-- /notifications/:id [↑]
Retrieve a specific notification.
name | description | required | location | default | schema |
---|---|---|---|---|---|
id | id | yes | path |
null
|
null |
destination | Filter by destination ID. | no | query |
null
|
|
PATCH
-- /notifications/:id [↑]
Update a notification.
name | description | required | location | default | schema |
---|---|---|---|---|---|
id | id | yes | path |
null
|
null |
body | Notification object. | yes | body |
null
|
|
bart-key | test header | no | header |
null
|
|
DELETE
-- /notifications/:id [↑]
Cancel a specific notification.
name | description | required | location | default | schema |
---|---|---|---|---|---|
id | id | yes | path |
null
|
null |