Skip to content

API Documentation

Emil Abraham edited this page Mar 1, 2019 · 10 revisions

Authorization

Authorize User - POST /auth

BODY:

  • user_email
  • user_password

RETURNS:

  • message - "Authorized" if successful
  • token - The JWT token that will be used as bearer token for all other functions

Users

GET /user/me

A simple function to return the authorized user's information to test authentication token

AUTHORIZATION: bearer

RETURNS: User object saved in the JWT

GET /user/all

A simple function to return all users and their information from the database

AUTHORIZATION: bearer

RETURNS: All Users

  • user_id - user id
  • user_email - user's email
  • user_password - user's password (development purposes)
  • org_id - User's organization id
  • first_name - User's first name
  • last_name - User's last name
  • create_time - User's time created

Admin

Register New User - POST /admin/register

AUTHORIZATION: bearer + admin role (not implemented yet)

BODY:

  • user_email
  • user_password
  • organization_id
  • first_name
  • last_name

RETURNS:

  • message - "Created User" if successful
  • user_id - Newly created user's id

Clone this wiki locally