Module: routes/api

api router module This module allows for programatic download of transcript data.
Source:

Methods

(async, private, static) routeDELETEApiMembers(req, res, next)

DELETE an existing member. Delete member in the members collection as specified by req.params.id. The deleted object will be returned.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
params.id String database _id
res Object response object
next function function call to next middleware
Source:

(async, private, static) routeDELETEApiRegistrations(req, res, next)

DELETE an existing registration. Delete an existing registration in the registrations collection as specified by req.params.id. The deleted object will be returned.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
params.id String database _id
res Object response object
next function function call to next middleware
Source:

(async, private, static) routeGETApiMembers(req, res, next)

GET all members. Return all members in either JSON or CSV format. JSON is returned by default. If ?return=csv is provided in the query, a CSV will be provided. If ?requrn=strictcsv, a CSV will be provided containing ONLY those options that are actually present in the database (for use with the CSV import capability). If the calling route provides req._id, then limit responses to just that member, by _id.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
user Object user object to check against 'api' capability
params.id String limit to responses to a single member by _id
query.return String optionally select non-JSON output format
res Object response object
next function function call to next middleware
Source:

(async, private, static) routeGETApiRegistrations(req, res, next)

GET all registration entries. Return all registration entries in either JSON or CSV format. JSON is returned by default. If ?return=csv is provided in the query, a CSV will be provided. If ?requrn=strictcsv, a CSV will be provided containing ONLY those options that are actually present in the database (for use with the CSV import capability).
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
user Object user object to check against 'api' capability
query.earliest Date filters so that no objects are returned older than this time
query.return String optionally select non-JSON output format
res Object response object
next function function call to next middleware
Source:

(async, private, static) routePOSTApiMembers(req, res, next)

POST a new member. Create a new member in the members collection as specified by req.body, and generate a new database identifier. The consutrcted object will be returned.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
body.memberID String memberID is a 64 bit int, so pass in as a string
body.councilID Number
body.firstName String
body.lastName String
body.access String
res Object response object
next function function call to next middleware
Source:

(async, private, static) routePOSTApiRegistrations(req, res, next)

POST a new registration. Create a new registration in the registrations collection as specified by req.body, and generate a new database identifier. The consutrcted object will be returned.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
body.memberID String memberID is a 64 bit int, so pass in as a string
body.councilID Number
body.date String in ISO format
body.type Number
body.title String
body.credits Number
body.instructor String
body.physical String
body.online String
body.status Number
res Object response object
next function function call to next middleware
Source:

(async, private, static) routePUTApiMembers(req, res, next)

PUT an existing member. Update a new member in the members collection as specified by req.params.id using the data in req.body. The consutrcted object will be returned.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
params.id String limit to responses to a single member by _id
body.memberID String memberID is a 64 bit int, so pass in as a string
body.councilID Number
body.firstName String
body.lastName String
body.access String
res Object response object
next function function call to next middleware
Source:

(async, private, static) routePUTApiRegistrations(req, res, next)

PUT an existing registration. Update an existing registration in the registrations collection as specified by req.body. The consutrcted object will be The consutrcted object will be returned.
Parameters:
Name Type Description
req Object request object
Properties
Name Type Description
params.id String database _id
body.memberID String memberID is a 64 bit int, so pass in as a string
body.councilID Number
body.date String in ISO format
body.type Number
body.title String
body.credits Number
body.instructor String
body.physical String
body.online String
body.status Number
res Object response object
next function function call to next middleware
Source: