Skip to content
Connor Onweller edited this page Dec 15, 2019 · 1 revision

Our API routes and a short descriptions are given below.

Authentication
POST /api/auth/register Register a new user
POST /api/auth/login Log into an existing account (Client or NP account)
GET /api/auth/authorize Send login confirmation (does not do any security checking, just sends confirmation)
GET /api/stuff/info Returns current user account info as json
Visits: Client Routes
GET /api/visits Index of all visits for current user
POST /api/visits Create new visit for current user
GET /api/visits/:id Get json for one visit with visit._id equal to :id if it exists
GET /api/visits/:id/symptoms Gets all the symptoms for current user's visit with visit._id equal to :id
POST api/visits/:id/symptoms Update the symptoms for current user's visit with visit._id equal to :id
POST api/:userid/visits/:id/diagnosis Update the diagnosis for current user's visit with visit._id equal to :id (should not be done by user, maybe take out this route or restrict it more)
POST api/visits/:id/notes Update the public notes on visit with visit._id equal to :id
Visits: Admin Routes
GET api/visits/np/:userid Index of all visits for user with id equal to :userid
GET api/visits/np/:userid/:id Show one visit for user with id equal to :userid with visit._id equal to :id
POST api/visits/np/:userid/:id/symptoms Update symptoms for one visit for user with id equal to :userid with visit._id equal to :id
POST api/visits/np/:userid/:id/diagnosis Update diagnosis for one visit for user with id equal to :userid with visit._id equal to :id
POST api/visits/np/:userid/:id/notes Update public notes for one visit for user with id equal to :userid with visit._id equal to :id
POST api/visits/np/:userid/:id/priv_notes Update private notes for one visit for user with id equal to :userid with visit._id equal to :id
Clone this wiki locally