Skip to content

API Endpoints

Sean Glancy edited this page Feb 11, 2019 · 1 revision

Recominder API


API Endpoints


  • POST '/register' Will create new user based on request object data. Will return an error if the email is already in use. Will return a success message with the user's id on successful user creation.
  • POST '/login' Will check user data supplied by request object against registered users, returning an error if not found and returning a success message with the user's id on successful login.
  • POST '/data' Will accept JSON input of HealthKit data, storing it to the database and echoing the stored data back to client.

Register/Login endpoint response


Status: Returns 'Successful', or 'Unsuccessful' .

userId: Returns the requested user's _id attribute .

token: Returns a JSON web token for web based client .

Message: Will return error messages .

Example Success Response


{"status":"Success","userId":"5c5f66e76392220017ea2e49","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1YzVmNjZlNzYzOTIyMjAwMTdlYTJlNDkiLCJpYXQiOjE1NDk3NTYxMzUsImV4cCI6MTU1NDk0MDEzNX0.dwrveYOMbXijiGwGcZAanEocOaD-YqquXFmnINR6eeY"}

Example Unsuccessful Response


{"status":"Unsuccessful","message":"This Email is already in use"}