The Flask app is running by default on port 8000. Here we assume that the app is running on localhost.
GET
http://localhost:8000/
POST
Register a new user.
http://localhost:8000/register
{
"username": "username",
"password": "password"
}
- 422 : User register failed:
{ "message": "User register failed" }
- 201: User register success:
{ "message": "User registered successfully", "token": "eyJhbGciOiJIUI1NiIsIn5cCI6IkpXVCJ9.ey1c2VyIjocGhpbEiLCJpZCIM30.v_lKLd0X-PABkRFXHZa..." }
POST
Login as user
http://localhost:8000/login
{
"username": "username",
"password": "password"
}
- 401: User login failed:
{ "message": "Wrong Password" }
- 200: User login success:
{ "message": "Log in successfully", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1..." }
POST
creatOrganisation
http://localhost:8000/creatOrganisation
{
"authorization": "---",
"organisationName": "---"
}
- 409: duplication Conflict:
{ "error": "name already exists." }
- 200: success:
{ "organisation_id": "---" }
POST
creatOrganisation
http://localhost:8000/addUserToOrganisation
{
"authorization": "---",
"organisationName": "---",
"newUser": "---"
}
- 409: duplication Conflict: (temp)
{ "error": "error message" }
- 200: success:
{ "organisation_id": "---" }
POST
Upload files.
http://localhost:8000/data/upload
file
(form-data): Files to uploadauthorization
(form-data): User authorization tokenorganisationId
(form-data): Organization ID
- 400: Upload failed:
Returns a list of document file types.
- 207: Upload partial success:
Returns a list of document file types and documentIds.
- 201: Upload success:
Returns a list of documentIds.
POST
get file.
http://localhost:8000/dev/getDocument/<_id>
- None
- String of File Content
POST
Create tables (Development).
http://localhost:8000/create-tables