-
Notifications
You must be signed in to change notification settings - Fork 0
API Documentation
Outline of the DB models, routes, and general format of the Let's Go REST API
- Event
- User
We handle authorization through JSON Web Tokens. These are passed through the Authorization
request header in the format: Authorization: Bearer {token}
, keep in mind that the header parser will not not be able to parse tokens that are passed in a different way, and will throw an unauthorized exception.
const token = 12345;
fetch(URL, {
Authorization: `Token ${token}`,
})
All endpoints return the response:
{
error: Boolean,
message: String,
data: Object
}
Base URL: /api/v0
*Note that endpoints with IMPL
next to them are deployed, and endpoints with TODO
next to them are yet to be deployed.
-
GET /auth/:token
IMPL- token: Valid JWT
- returns: JSON data dump of user
-
GET /events/public/:page
IMPL- page: Current page of events (PAGE_LIMIT = 40)
- returns: List of public events
-
GET /events/byIDs
TODO- ids: List of event IDs
- returns: List of event objects from IDs
-
GET /events/recommended/:page
TODO- page: Current page of events (PAGE_LIMIT = 40)
- returns: List of recommended events
-
GET /events/nearby/:radius
IMPL- radius: Integer, Miles
- min: 1, max: 50
- returns: List of events within the provided radius
- radius: Integer, Miles
-
GET /events/search/:query
IMPL- query: Query string
- returns: List of events matching the query
-
GET /events/attendees/:id
IMPL- id: Event ID
- returns: List of attendees (user objects) of that event
-
POST /auth/signup
IMPL- user: Valid User Object
- returns: User that was saved to DB
-
POST /auth/login
IMPL- user:
- email: Email of the user
- password: Password
- returns: Valid JWT of the user
- user:
-
POST /events/create-event
IMPL- event: Valid event object
- returns: Event that was added to DB or failure
-
PUT /events/edit
IMPL- eventID: ID of the event to edit
- fields: Array of fields to be updated
- values: Array of values to be inserted into those fields
-
PUT /events/attend/
IMPL- eventID: ID of the event to attend
- returns: Success status
-
PUT /auth/update
IMPL- fields: Array of fields to be updated
- values: Array of values to be inserted into those fields
-
DELETE /events
IMPL- eventID: ID of the event to delete
© Let's Go Inc.