http://sentimentbot-1.herokuapp.com/api
Teams JSON to get an idea of the data structure:
http://sentimentbot-1.herokuapp.com/api/teams
POST api/users
Request Body:
{ firstName: String, lastName: String, email: String, password: String }
POST api/tokens
Request Body:
{ email: String, password: String }
Note: This endpoint should be used after logging in and decoding the JWT token in the front end to get the userId to retrieve all user attributes.
POST api/join
Request Body:
{ code: Integer }
POST api/users/:userId/responses
Request Body:
{ mood: String, emoji: String }
Optional :
{ imageUrl: String, surveyId: Integer, longitude: Float, latitude: Float }
Note: Team receives responses through users which is why surveyId is optional. Beyond MVP once a user can join multiple teams this will not work and needs to fixed. Longitude and Latitude is only required for mobile.
POST api/users/:userId/teams
Request Body:
{ teamName: String }
GET api/teams/:teamId/responses
Request Body:
N/A
POST api/teams/:teamId/surveys
Request Body:
{ schedule: String }
Optional :
{ question: String }
Note: Question is optional for now because MVP will simple ask "How do you feel?", however the field is present for future feature expansion
PUT api/surveys/:id
Request Body:
{ schedule: string }
Note: This is what will trigger the change in notification whether that be daily,weekly, or monthly.
GET api/teams/:teamId/surveys
Request Body:
N/A
Note: Only use first survey object in team's surveys array. MVP will be static to one survey.
GET api/surveys/:surveyId/feelings
Request Body:
N/A
POST api/surveys/:surveyId/feelings
Request Body:
{ mood: String, emoji: String }
DELETE api/feelings/:id
Request Body:
N/A
DELETE api/:teamid/users/:id
Request Body:
N/A
POST api/changePassword
Request Body:
{ password: String }