- Minimal api docs
This contains bare minimum documentation for api endpoints
Note: All the endpoints require the user to be logged in. Only exception is user login and organization register.
This api end point handles user registration, organization profile and deleting an employee account that belongs to the organization.
It will respond with information about the organization account keys of json object are email, id, firstName, lastName, role, createdAt, name, numberOfEmployees, city and country.
Note: User with role ORGANIZATION or ADMIN can create accounts. When organization user creates an account the user will belong to that organization.
Creates user account with value of role EMPLOYEE in the backend with the specified data
Required keys of json data in the body:
{
"name": "ABC",
"email": "[email protected]",
"password": "Abcd@1234",
"confirmPassword": "Abcd@1234",
"numberOfEmployees": 9,
"city": "Jyvaskyla",
"country": "Finland" # Optional default is Finland
}
Note: Allowed for users having role ORGANIZATION
This endpoint will delete the employee the user account of the user by email, if the user belongs to the organization
Required keys of json data in the body:
{
"email": "[email protected]"
}
This api end point handles user registration, login, logout, getting user profile and giving user admin permission.
Note: only admins can create, update and delete languages. Others can only read.
It will respond with information about the user account keys of json object are firstName, lastName, email, role, createdAt and worksAtOrganizationId.
Note: User with role ORGANIZATION or ADMIN can create accounts. When organization user creates an account the user will belong to that organization.
Creates user account with value of role EMPLOYEE in the backend with the specified data
Required keys of json data in the body:
{
"firstName": "ABC",
"lastName": "DEF",
"email": "[email protected]",
"password": "Abcd@1234",
"confirmPassword": "Abcd@1234"
}
Logs in a user by setting http only cookie using set-cookie header. It will return with http status code 204 No Content when successful.
Required keys of json data in the body:
{
"email": "[email protected]",
"password": "Abcd@1234"
}
Logs out a logged in user by clearing the http only cookie.
Note: Allowed for only admin users.
This endpoint will make a pre existing normal user(eg. role="EMPLOYEE") account to admin.
Required keys of json data in the body:
{
"email": "[email protected]"
}
This api end point handles CRUD operations for languages in database.
Note: only admins can create, update and delete languages. Others can only read.
It will respond with all languages from database
It will respond with the language that has the specified id. Will respond with 404 http status code if the language does not exist.
Creates language in the backend with the specified data
Required keys of json data in the body:
{
"name": "string",
"code": "language code",
"unicodeFlag": "🇧🇩"
}
Updates a language by id and currently requires the keys same as POST request
Deletes a language by id.
This api end point handles CRUD operations for categories in database.
Note: only admins can create, update and delete categories. Others can only read.
It will respond with all categories from database
It will respond with the category that has the specified id. Will respond with 404 http status code if the category does not exist.
Creates category in the backend with the specified data
Required keys of json data in the body:
{
"languageId": 1,
"name": "Organization",
"Description": "Organization level objectives should be under this category"
}
Here languageId
should be provided from data acquired from language api endpoint
Updates a category by id and currently requires the keys same as POST request
Deletes a category by id.
This api end point handles CRUD operations for SubCategories in database.
Note: only admins can create, update and delete SubCategories which will be visible to all users. These can't be modified by anyone but other admins. Organization or a user belonging to an organization can create sub categories which will be visible to the users belonging to the same organization.
It will respond with all SubCategories from database that are either created by admins or the organization the user belongs to or the user is.
It will respond with the subCategory that has the specified id. Will respond with 404 http status code if the subCategory does not exist. Or respond with 401 when user does not have permission to the subCategory.
Creates subCategory in the backend with the specified data.
Required keys of json data in the body:
{
"categoryId": 1,
"name": "Administrative",
"Description": "Objectives related to management should be under this sub category"
}
Here categoryId
should be provided from data acquired from category api endpoint
Updates a subCategory by id and currently requires the keys same as POST request
Deletes a subCategory by id.
This api end point handles CRUD operations for objectives in database.
Note: Objectives that are created by admins will be visible to all users. These can't be modified by anyone but other admins. Organization or a user belonging to an organization can create objectives which will be visible to the users belonging to the same organization.
It will respond with all objectives from database that are either created by admins or the organization the user belongs to or the user is.
It will respond with the objective that has the specified id. Will respond with 404 http status code if the objective does not exist. Or respond with 401 when user does not have permission to the objective.
Creates objective in the backend with the specified data.
Required keys of json data in the body:
{
"subCategoryId": 1,
"name": "objective 1",
"Description": "Description for objective"
}
Here subCategoryId
should be provided from data acquired from subCategory api endpoint
Updates a objective by id and currently requires the keys same as POST request
Deletes a objective by id.