Our API can be accessed from our domain at these endpoints.
Events
Our Events are JSON Objects that contain basic information about any upcoming trips. The fields of this object are listed below, along with their types and hyperparameters:
Parameter
Type
Description
title
String
The title of an event. Default: “”
startDate
Date
The date of the event.
passengerList
Array
Array of User Objects.
departure
Object
Contents specified below. required.
destination
Object
Contents specified below. required.
owner
User
The owner of the event. required.
notes
String
Any notes by the owner. Default: “”
capacity
Number
The total capacity of the event. required.
Departure Object:
Parameter
Type
Description
name
String
Name of the departure location. required.
address
String
Address of the departure location.
location
Array
Array of numbers (2) to specify the coordinates.
Destination Object:
Parameter
Type
Description
name
String
Name of the destination location. required.
address
String
Address of the destination location.
location
Array
Array of numbers (2) to specify the coordinates.
Event Routing
Here is a summary of all of our routes for events. Note that all of these events are exclusive to requests with a bearer token.
Request
Route
Auth
Description
GET
/api/events
Bearer Token
Gets a list of events with specified filter.
GET
/api/events/:id
Bearer Token
Gets the event specified.
GET
/api/events/joined
Bearer Token
Gets a list of events joined by the token user.
POST
/api/events
Bearer Token
Creates a new event with the params.
DELETE
/api/events/:id
Bearer Token
Deletes the event specified.
PUT
/api/events/:id
Bearer Token
Updates the event specified.
Requests & Responses:
GET /api/events
(All optional parameters for search)
req = { title, start, end, departure, destination, notes }
Our Users are JSON Objects that contain information extracted from SSO and the events that the users own/joined. None of these routes (except PUT) can actually be accessed by users, as they are only for administrative purposes. The fields of this object are listed below, along with their types and hyperparameters:
Parameter
Type
Description
jhed
String
JHED of a user. required.unique.
email
String
Email of a user. required.unique.
username
String
Username of a user. required.unique.
isAdmin
Boolean
Self-explanatory. required.defalult:false
eventsOwned
Array
Array of Event Objects. required.
eventsJoined
Array
Array of Event Objects. required.
subscribed
Boolean
Subscribed to email notifications. required.
venmo
String
Venmo username. required.
User Routing
Request
Route
Auth
Description
GET
/api/users
Admin
Gets a list of all users.
GET
/api/users
Bearer Token
Gets the user specified.
POST
/api/users
Admin
Creates a new user with the params.
DELETE
/api/users/:id
Admin
Deletes the user specified.
PUT
/api/users/:id
Bearer Token
Updates the user specified.
GET /api/users/all
Code
Response
200
Array of User objects
403
Invalid/missing token
500
Invalid authorization
GET /api/users
Code
Response
200
Single User object
403
Invalid/missing token
404
No user with ID
POST /api/users
req.body = { username, jhed, email }
Code
Response
201
Single User object
400
Error: Missing/invalid jhed
400
Error: Missing username
400
Error: Missing email
400
Error: Missing venmo username
400
Error: Profane username
400
Error: Username over 20 characters
403
Invalid/missing token
DELETE /api/users/:id
Code
Response
200
Single User object
403
Invalid/missing/unauthorized token
500
Invalid authorization
PUT /api/users/
Code
Response
200
Single User object
400
Error: Missing username
400
Error: Profane username
403
Invalid/missing token
SSO
Our SSO utilizes 4 endpoints, three for authentication with an external server (JHU) and one for token verification.
SSO Routing
Here is a summary of all our routes for SSO and tokenization.