This repo showcase API development using Spring-Boot Technology stack using pure Kotlin.
Currently, the APIs are in WIP and being used in this HarvestKMM
project.
Servers
Clone this project
Run following command
Run project and Enjoy!
Spring Boot
Spring Boot Actuator
Spring Data JPA
Spring Data REST
Hibernate
Spring REST Docs
Kotlin
H2 DB
Maven
POST BASE_URL/api/v1/public/login
Request Body
param
type
Description
Email
String
Users official email id.
Password
String
Password, which user set while sign up.
Response
When -> 200 OK
{
"token" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhNTA1MjYwZi03YmZhLTRiZDUtODBjZS04MDBmOGE0M2IzZmMiLCJpYXQiOjE2NTM5Mzg2NzUsImV4cCI6MTY1Mzk0MjI3NX0.1CydFVIwoWq4gaqUhhEBy9XpQVaed-XW0s9qn0uFkUIg4h3WXiQkZrYUqULU0ZxeFMX1jfEMqO9FtTwt3zD5Zw" ,
"message" : "User logged in Successfully" ,
"refreshToken" : "958ede86-163c-4e80-8d8f-ed81ff1d7421"
}
param
type
Description
token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
message
String
Returns info for every type of request.
refreshToken
String
Unique Token for each user
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/public/signup
Request Body
For New Organization User SignUp ->
{
"email" :"[email protected] " ,
"password" :"password" ,
"firstName" :"Yugesh" ,
"lastName" :"Jain" ,
"harvestOrganization" :{
"name" :"mm" ,
"website" :"mm.com" ,
"identifier" :"com.mm.org"
}
}
param
type
Description
email
String
Users official email id.
password
String
Password, which user set while sign up.
firstName
String
First Name of the user Signing Up
lastName
String
Last Name of the user Signing Up
harvestOrganization
HarvestOrganization
Organization Details
name
String
User's Organization Name
website
String
Web Address for the Organization
identifier
String
Unique Identifier for the Organization
For Existing Organization User SignUp ->
{
"email" :"[email protected] " ,
"password" :"password" ,
"firstName" :"Yugesh" ,
"lastName" :"Jain" ,
"orgId" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"role" : String ,
}
param
type
Description
email
String
Users official email id.
password
String
Password, which user set while sign up.
firstName
String
First Name of the user Signing Up
lastName
String
Last Name of the user Signing Up
orgId
String
Auto Generated Unique ID assigned to the Organization
role
String
Role of user in the organization like Admin or normal employee
Response
When -> 200 OK : Registration Successful! Please verify your email before getting started!
{
"message" : "Registration Successful! Please verify your email before getting started!" ,
"data" : {
"id" : "f8296e81-6d5b-4a5e-9de4-9d60459a1997" ,
"firstName" : "Yugesh" ,
"lastName" : "Jain" ,
"email" : "[email protected] " ,
"modifiedTime" : "Sat Jun 04 12:03:52 UTC 2022" ,
"orgId" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"harvestOrganization" : {
"name" : "mm" ,
"website" : "mm.com" ,
"id" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"identifier" : "com.mm.org"
}
}
}
param
type
Description
message
String
Returns info for every type of request.
data
Data
Details of the User Just Signed Up
id
String
Auto Generated Unique ID assigned to a User
firstName
String
First Name of the User Just Signed Up
lastName
String
Last Name of the User Just Signed Up
email
String
Email of the User Just Signed Up
modifiedTime
String
Time of successful Signup
orgId
String
Auto Generated Unique ID assigned to the Organization
harvestOrganization
HarvestOrganization
Organization Details
name
String
User's Organization Name
website
String
Auto Generated Unique ID assigned to the Organization
id
String
Returns info for every type of request.
identifier
String
Unique Identifier for the Organization
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/logout
Request Body
Authorization
param
type
Description
userId
String
Auto Generated Unique ID assigned to a User
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK : Registration Successful! Please verify your email before getting started!
{
"message" : "Logged Out Successfully!!"
}
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/changePassword
Request Body
{
"password" : String ,
"oldPassword" : String
}
Authorization
param
type
Description
password
String
New Password that we want to set for the account Logged in
oldPassword
String
Existing Password of the account Logged in
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK : Password Changed
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Request Body
Authorization
param
type
Description
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK : Password Changed
{
"message" : String ,
"data" :{
"email" : String ,
"firstName" : String ,
"id" : String ,
"lastName" : String ,
"modifiedTime" : String ,
"orgId" : String ,
"role" : String
}
}
param
type
Description
message
String
Returns info for every type of request.
data
Data
Details of the User Just Signed Up
id
String
Auto Generated Unique ID assigned to a User
firstName
String
First Name of the User Just Signed Up
lastName
String
Last Name of the User Just Signed Up
email
String
Email of the User Just Signed Up
modifiedTime
String
Time of successful Signup
orgId
String
Auto Generated Unique ID assigned to the Organization
role
String
Role of the user in the Organization
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Request Body
{
"id" : "f8296e81-6d5b-4a5e-9de4-9d60459a1997" ,
"firstName" : "Yugesh" ,
"lastName" : "Jain" ,
"email" : "[email protected] " ,
"orgId" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"role" : String ,
"pushToken" : String ,
"profilePic" : String ,
"harvestOrganization" : {
"name" : "mm" ,
"website" : "mm.com" ,
"id" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"identifier" : "com.mm.org"
}
} ]
Authorization
param
type
Description
id
String
Auto Generated Unique ID assigned to a User
firstName
String
First Name of the User Just Signed Up
lastName
String
Last Name of the User Just Signed Up
email
String
Email of the User Just Signed Up
orgId
String
Auto Generated Unique ID assigned to the Organization
role
String
Role of user in the organization like Admin or normal employee
pushToken
String
Auto Generated Unique ID assigned to the User
profilePic
String
Url to the Uploaded Profile Picture
harvestOrganization
HarvestOrganization
Organization Details
name
String
User's Organization Name
website
String
Auto Generated Unique ID assigned to the Organization
id
String
Returns info for every type of request.
identifier
String
Unique Identifier for the Organization
BearerToken
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK : Password Changed
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/fcmToken
Request Body
{
"id" : "f8296e81-6d5b-4a5e-9de4-9d60459a1997" ,
"firstName" : "Yugesh" ,
"lastName" : "Jain" ,
"email" : "[email protected] " ,
"orgId" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"role" : String ,
"pushToken" : String ,
"profilePic" : String ,
"harvestOrganization" : {
"name" : "mm" ,
"website" : "mm.com" ,
"id" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"identifier" : "com.mm.org"
}
} ]
Authorization
param
type
Description
id
String
Auto Generated Unique ID assigned to a User
firstName
String
First Name of the User Just Signed Up
lastName
String
Last Name of the User Just Signed Up
email
String
Email of the User Just Signed Up
orgId
String
Auto Generated Unique ID assigned to the Organization
role
String
Role of user in the organization like Admin or normal employee
pushToken
String
Auto Generated Unique ID assigned to the User
profilePic
String
Url to the Uploaded Profile Picture
harvestOrganization
HarvestOrganization
Organization Details
name
String
User's Organization Name
website
String
Auto Generated Unique ID assigned to the Organization
id
String
Returns info for every type of request.
identifier
String
Unique Identifier for the Organization
BearerToken
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
{
"token" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhNTA1MjYwZi03YmZhLTRiZDUtODBjZS04MDBmOGE0M2IzZmMiLCJpYXQiOjE2NTM5Mzg2NzUsImV4cCI6MTY1Mzk0MjI3NX0.1CydFVIwoWq4gaqUhhEBy9XpQVaed-XW0s9qn0uFkUIg4h3WXiQkZrYUqULU0ZxeFMX1jfEMqO9FtTwt3zD5Zw" ,
"message" : "User logged in Successfully" ,
"refreshToken" : "958ede86-163c-4e80-8d8f-ed81ff1d7421"
}
param
type
Description
token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
message
String
Returns info for every type of request.
refreshToken
String
Unique Token for each user
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/refreshToken
Request Body
{
"refreshToken" : String ,
}
param
type
Description
refreshToken
String
Unique Token for each user
Response
When -> 200 OK
{
"token" : "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhNTA1MjYwZi03YmZhLTRiZDUtODBjZS04MDBmOGE0M2IzZmMiLCJpYXQiOjE2NTM5Mzg2NzUsImV4cCI6MTY1Mzk0MjI3NX0.1CydFVIwoWq4gaqUhhEBy9XpQVaed-XW0s9qn0uFkUIg4h3WXiQkZrYUqULU0ZxeFMX1jfEMqO9FtTwt3zD5Zw" ,
"message" : String ,
"refreshToken" : "958ede86-163c-4e80-8d8f-ed81ff1d7421"
}
param
type
Description
token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
message
String
Returns info for every type of request.
refreshToken
String
Unique Token for each user
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/public/forgotPassword
Parameters
param
type
Description
email
String
Email Address of the account for the one who's password is forgotten
Response
When -> 200 OK
{
"message" : "Email to reset the password sent to your Email"
}
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/resetPassword
Request Body
{
"token" : String ,
"password" : String
}
param
type
Description
token
String
JWT Token for security purpose. We will get this from the email deep link.
password
String
New Password that we want to set for the account
Response
When -> 200 OK
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Find Organization By Identifier
GET BASE_URL/api/v1/public/organization
Parameters
param
type
Description
identifier
String
Unique Identifier for the Organization
Response
When -> 200 OK
{
"message" : String
"harvestOrganization" : {
"name" : "mm" ,
"website" : "mm.com" ,
"imgUrl" : "www.someimg.png"
"id" : "151d11a3-780d-4f03-bbad-889bd3707b02" ,
"identifier" : "com.mm.org"
}
}
param
type
Description
message
String
Returns info for every type of request.
harvestOrganization
HarvestOrganization
Organization Details
name
String
User's Organization Name
website
String
Auto Generated Unique ID assigned to the Organization
imgUrl
String
Url to the Organization uploaded Logo
id
String
Returns info for every type of request.
identifier
String
Unique Identifier for the Organization
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Organization Projects Api
GET BASE_URL/api/v1/organization/project
Request Body
{
"name" : String ,
"client" : String ,
"isIndefinite" : Boolean ,
"startDate" : String ,
"endDate" : String
}
Authorization
param
type
Description
name
String
Name of the project to be created
client
String
Name of the client who's project is thisClient
isIndefinite
Boolean
Is the project indefinite or not
startDate
String
Start date of the Project
endDate
String
End date of the Project
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
{
"message" : String
"data" : {
"id" : String ,
"name" : String ,
"client" : String ,
"isIndefinite" : Boolean ,
"startDate" : String ,
"endDate" : String ,
"organizationId" : String
}
}
param
type
Description
message
String
Returns info for every type of request.
id
String
Unique Auto generated Id for the project
name
String
Name of the project to be created
client
String
Name of the client who's project is thisClient
isIndefinite
Boolean
Is the project indefinite or not
startDate
String
Start date of the Project
endDate
String
End date of the Project
orgId
String
Unique Auto generated Organization Id in which the project is created
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
PUT BASE_URL/api/v1/organization/project
Request Body
{
"id" : String ,
"name" : String ,
"client" : String ,
"isIndefinite" : Boolean ,
"startDate" : String ,
"endDate" : String ,
"organizationId" : String
}
Authorization
param
type
Description
id
String
Unique Auto generated Id for the project
name
String
Name of the project to be created
client
String
Name of the client who's project is thisClient
isIndefinite
Boolean
Is the project indefinite or not
startDate
String
Start date of the Project
endDate
String
End date of the Project
organizationId
String
Unique Auto generated Organization Id in which the project is created
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
DELETE BASE_URL/api/v1/organization/project
Parameters
Authorization
param
type
Description
projectId
String
Unique Auto generated Id for the project
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Find Projects In Organization
GET BASE_URL/api/v1/public/organization/project
Parameters
orgId: String ,
offset : Int ,
limit : Int ,
search : String
Authorization
param
type
Description
orgId
String
Unique Auto generated Organization Id in which the project is created
offSet
Int
Offset
limit
Int
Limit per Page
search
String
Name of the project you want to search in the searchbar
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
{
"message" : String
"data" : [
{
"id" : String ,
"name" : String ,
"client" : String ,
"isIndefinite" : Boolean ,
"startDate" : String ,
"endDate" : String ,
"organizationId" : String
}
]
}
param
type
Description
message
String
Returns info for every type of request.
id
String
Unique Auto generated Id for the project
name
String
Name of the project to be created
client
String
Name of the client who's project is thisClient
isIndefinite
Boolean
Is the project indefinite or not
startDate
String
Start date of the Project
endDate
String
End date of the Project
organizationId
String
Unique Auto generated Organization Id in which the project is created
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
List of users in a Project
GET BASE_URL/api/v1/organization/project/list-users
Parameters
Authorization
param
type
Description
projectId
String
Unique Auto generated Id for the project
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
{
"message" : String
"data" : [
{
"email" : String ,
"firstName" : String ,
"id" : String ,
"lastName" : String ,
"modifiedTime" : String ,
"orgId" : String ,
"role" : String
}
]
}
param
type
Description
message
String
Returns info for every type of request.
data
Data
Details of the User Just Signed Up
id
String
Auto Generated Unique ID assigned to a User
firstName
String
First Name of the User Just Signed Up
lastName
String
Last Name of the User Just Signed Up
email
String
Email of the User Just Signed Up
modifiedTime
String
Time of successful Signup
orgId
String
Auto Generated Unique ID assigned to the Organization
role
String
Role of the user in the Organization
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Find Users in Organization
GET BASE_URL/api/v1/organization/users
Parameters
userType: Int ,
orgIdentifier : String ,
isUserDeleted : Boolean ,
offset : Int ,
limit : Int ,
search : String
Authorization
param
type
Description
userType
Int
Role of the user
orgIdentifier
String
Unique identifier for an Organization
isUserDeleted
Boolean
Boolean to see if the user is Deleted or not
offSet
Int
Offset
limit
Int
Limit per Page
search
String
Name of the user you want to search in the searchbar
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
{
"message" : String
"data" : [
{
"email" : String ,
"firstName" : String ,
"id" : String ,
"lastName" : String ,
"modifiedTime" : String ,
"orgId" : String
}
]
}
param
type
Description
message
String
Returns info for every type of request.
data
Data
Details of the User Just Signed Up
id
String
Auto Generated Unique ID assigned to a User
firstName
String
First Name of the User Just Signed Up
lastName
String
Last Name of the User Just Signed Up
email
String
Email of the User Just Signed Up
modifiedTime
String
Time of successful Signup
orgId
String
Auto Generated Unique ID assigned to the Organization
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/org-admin/assign-user-project
Request Body
{
"projectMap" : HashMap < projectId , List < userId > >
}
Authorization
param
type
Description
projectId
String
Unique Auto Generated ID for Project
userId
String
Unique Auto Generated ID for User
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
POST BASE_URL/api/v1/user/project/log-work
Request Body
{
"id" : String ,
"projectId" : String ,
"userId" : String ,
"workDate" : String ,
"workHours" : Float ,
"note" : String
}
Authorization
param
type
Description
id
String
ID
projectId
String
Unique Auto Generated ID for Project
userId
String
Unique Auto Generated ID for User
workDate
String
Date on which the work is done
workHours
String
Number of hours dedicated to the particular work
Bearer Token
String
JWT Token for security purpose. This get generated once users Logged In Successfully.
Response
When -> 200 OK
param
type
Description
message
String
Returns info for every type of request.
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Get Projects Assigned to a user
GET BASE_URL/api/v1/user/assigned-projects
Parameters
Authorization
param
type
Description
userId
String
Unique Auto Generated Id for a User
Response
When -> 200 OK
{
"message" : String
"data" : [
{
"id" : String ,
"name" : String ,
"client" : String ,
"isIndefinite" : Boolean ,
"startDate" : String ,
"endDate" : String ,
"organizationId" : String
}
]
}
param
type
Description
message
String
Returns info for every type of request.
id
String
Unique Auto generated Id for the project
name
String
Name of the project to be created
client
String
Name of the client who's project is thisClient
isIndefinite
Boolean
Is the project indefinite or not
startDate
String
Start date of the Project
endDate
String
End date of the Project
organizationId
String
Unique Auto generated Organization Id in which the project is created
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.
Get Work Logs for a Date Range
GET BASE_URL/api/v1/user/project/log-work
Request Body
{
"startDate" : String ,
"endDate" : String ,
"userIds" : List < String >
}
Authorization
param
type
Description
startDate
String
Date from which you want the logs
endDate
String
Date till which you want the logs
userIds
List<String>
user Ids for those you want the logs
Response
When -> 200 OK
{
"message" : String
"data" : [
{
"id" : String ,
"projectId" : String ,
"userId" : String ,
"workDate" : String ,
"workHours" : Float ,
"note" : String
}
]
}
param
type
Description
message
String
Returns info for every type of request.
projectId
String
Unique Auto generated Id for the project
userId
String
Unique Auto generated Id for the user
workDate
String
Date on which the work is done
workHours
Float
Number of hours dedicated to the work on that date
note
String
Note
When -> 400 BAD REQUEST
param
type
Description
message
String
Returns info for every type of request.