YManager API documentation
/users
Employer only.
get /users
Employer only.
Accessible with OAuth2 authentication token.
Query Parameters
- status: (one of ACCEPTED, PENDING, REJECTED)
HTTP status code 200
OK.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
the user's id
- firstName: required(string)
the user's first name
- lastName: required(string)
the user's last name
- photo: required(string)
the URL of a photo
- calendar: required(array of VacationDayDTO)
the list of selected vacation in +-7 days
Items: VacationDayDTO
- id: required(integer)
the id of the vacation/sick day
- date: required(string)
the date of the vacation/sick day in yyyy/mm/dd format
- from: required(union of string or nil)
the start of the vacation, null for sick days
- to: required(union of string or nil)
the end of the vacation, null for sick days
- type: required(one of VACATION, SICK_DAY)
- status: required(one of ACCEPTED, PENDING, REJECTED)
- id: required(integer)
HTTP status code 400
Bad request. Check query parameters.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
Employer only.
get /users/requests/vacation
Employer only.
Accessible with OAuth2 authentication token.
Query Parameters
- status: (one of ACCEPTED, PENDING, REJECTED)
HTTP status code 200
OK.
Body
Media type: application/json
Type: array of object
Items: UserVacationRequestDTO
- id: required(integer)
the user's id
- firstName: required(string)
the user's first name
- lastName: required(string)
the user's last name
- date: required(string)
the date of the vacation/sick day in yyyy/mm/dd format
- from: required(union of string or nil)
the start of the vacation, null for sick days
- to: required(union of string or nil)
the end of the vacation, null for sick days
- type: required(one of VACATION, SICK_DAY)
the approval status of the request
- status: required(one of ACCEPTED, PENDING, REJECTED)
- timestamp: required(string)
the creation of the request in yyyy/mm/dd hh:mm:ss format
HTTP status code 400
Bad request. Check query parameters.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
Employer only.
get /users/requests/authorization
Employer only.
Accessible with OAuth2 authentication token.
Query Parameters
- status: (one of ACCEPTED, PENDING, REJECTED)
HTTP status code 200
OK.
Body
Media type: application/json
Type: array of object
Items: UserAuthorizationRequestDTO
- id: required(integer)
the user's id
- firstName: required(string)
the user's first name
- lastName: required(string)
the user's last name
- status: required(one of ACCEPTED, PENDING, REJECTED)
the status of the authorisation
- timestamp: required(string)
the creation of the request in yyyy/mm/dd hh:mm:ss format
HTTP status code 400
Bad request. Check query parameters.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
get /users/current/profile
Accessible with OAuth2 authentication token.
HTTP status code 200
OK.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
the user's id
- firstName: required(string)
the user's first name
- lastName: required(string)
the user's last name
- photo: required(string)
the URL of a photo
- vacationCount: required(number)
the number of available vacations
- sickDayCount: required(integer)
the number of assigned sick days
- takenSickDayCount: required(integer)
the number of taken sick days
- status: required(one of ACCEPTED, PENDING, REJECTED)
the authorisation status
- role: required(one of EMPLOYEE, EMPLOYER)
the user role
- notification: required(string)
the notification of an incoming reset of remaining vacations and sick days in yyyy/mm/dd hh:mm:ss format
- email: required(string)
the user's email address
Example:
{
"id": 4,
"firstName": "Pavel",
"lastName": "Fidransky",
"photo": "https://st2.depositphotos.com/9223672/12056/v/950/depositphotos_120568236-stock-illustration-male-face-avatar-logo-template.jpg",
"vacationCount": 0.0,
"sickDayCount": 5,
"takenSickDayCount": 0,
"status": "ACCEPTED",
"role": "EMPLOYEE",
"notification": "2019/12/01 12:00:00",
"email": "pavel.fidransky@yoso.fi"
}
HTTP status code 401
Not authenticated.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
get /users/{id}/profile
Accessible with OAuth2 authentication token.
URI Parameters
- id: required(integer)
the user's id
HTTP status code 200
OK.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
the user's id
- firstName: required(string)
the user's first name
- lastName: required(string)
the user's last name
- photo: required(string)
the URL of a photo
- vacationCount: required(number)
the number of available vacations
- sickDayCount: required(integer)
the number of assigned sick days
- takenSickDayCount: required(integer)
the number of taken sick days
- status: required(one of ACCEPTED, PENDING, REJECTED)
the authorisation status
- role: required(one of EMPLOYEE, EMPLOYER)
the user role
- notification: required(string)
the notification of an incoming reset of remaining vacations and sick days in yyyy/mm/dd hh:mm:ss format
- email: required(string)
the user's email address
Example:
{
"id": 4,
"firstName": "Pavel",
"lastName": "Fidransky",
"photo": "https://st2.depositphotos.com/9223672/12056/v/950/depositphotos_120568236-stock-illustration-male-face-avatar-logo-template.jpg",
"vacationCount": 0.0,
"sickDayCount": 5,
"takenSickDayCount": 0,
"status": "ACCEPTED",
"role": "EMPLOYEE",
"notification": "2019/12/01 12:00:00",
"email": "pavel.fidransky@yoso.fi"
}
HTTP status code 400
Bad request. Check URI parameters.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 404
User with given ID doesn't exist.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
/user
Employer or calendar owner only.
get /user/{id}/calendar
Employer or calendar owner only.
Accessible with OAuth2 authentication token.
URI Parameters
- id: required(integer)
the user's id
Query Parameters
- from: required(string)
yyyy/mm/dd
- to: (string)
yyyy/mm/dd
- status: (one of ACCEPTED, PENDING, REJECTED)
HTTP status code 200
OK.
Body
Media type: application/json
Type: array of object
Items: VacationDayDTO
- id: required(integer)
the id of the vacation/sick day
- date: required(string)
the date of the vacation/sick day in yyyy/mm/dd format
- from: required(union of string or nil)
the start of the vacation, null for sick days
- to: required(union of string or nil)
the end of the vacation, null for sick days
- type: required(one of VACATION, SICK_DAY)
- status: required(one of ACCEPTED, PENDING, REJECTED)
HTTP status code 400
Bad request. Check query parameters.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 404
User with given ID doesn't exist.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
Employer or calendar owner only.
post /user/calendar/create
Employer or calendar owner only.
Accessible with OAuth2 authentication token.
Body
Media type: application/json
Type: object
Properties- date: required(string)
the date of the vacation/sick day in yyyy/mm/dd format
- from: required(union of string or nil)
the start of the vacation, null for sick days
- to: required(union of string or nil)
the end of the vacation, null for sick days
- type: required(one of VACATION, SICK_DAY)
HTTP status code 200
OK.
HTTP status code 400
Bad request. Check request body.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
Denied to all.
put /user/calendar/edit
Denied to all.
Accessible with OAuth2 authentication token.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
the id of the vacation/sick day
- date: required(string)
the date of the vacation/sick day in yyyy/mm/dd format
- from: required(union of string or nil)
the start of the vacation, null for sick days
- to: required(union of string or nil)
the end of the vacation, null for sick days
HTTP status code 403
Not authorized.
Secured by oauth_2_0
Employer or calendar owner only.
put /user/settings
Employer or calendar owner only.
Accessible with OAuth2 authentication token.
Body
Media type: application/json
Type: object
Properties- id: required(integer)
the user's ID
- vacationCount: required(number)
the remaining vacations
- sickDayCount: required(integer)
the number of assigned sick days
- role: required(one of EMPLOYEE, EMPLOYER)
the user role
- notification: required(string)
the date and time of sending an email warning about an incoming reset of remaining overtimes and sick days
Example:
{
"id": 4,
"vacationCount": 0.0,
"sickDayCount": 5,
"role": "EMPLOYEE",
"notification": "2019/12/01 12:00:00"
}
HTTP status code 200
OK.
HTTP status code 400
Bad request. Check request body.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
Employer only.
put /user/requests
Employer only.
Accessible with OAuth2 authentication token.
Query Parameters
- type: required(one of VACATION, AUTHORIZATION)
Body
Media type: application/json
Type: object
Properties- id: required(integer)
the id of the vacation/sick day
- status: required(one of ACCEPTED, PENDING, REJECTED)
HTTP status code 200
OK.
HTTP status code 400
Bad request. Check query parameters and request body.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 404
Neither vacation nor authorization request with given ID exists.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
/settings
Employer only.
get /settings
Accessible with OAuth2 authentication token.
HTTP status code 200
OK.
Body
Media type: application/json
Type: object
Properties- sickDayCount: required(integer)
the number of assigned sick days
- notification: required(string)
the notification of an incoming reset of remaining vacations and sick days in yyyy/mm/dd hh:mm:ss format
Example:
{
"sickDayCount": 5,
"notification": "2019/12/01 12:00:00"
}
HTTP status code 500
Internal server error.
Secured by oauth_2_0
post /settings
Employer only.
Accessible with OAuth2 authentication token.
Body
Media type: application/json
Type: object
Properties- sickDayCount: required(integer)
the number of assigned sick days
- notification: required(string)
the notification of an incoming reset of remaining vacations and sick days in yyyy/mm/dd hh:mm:ss format
Example:
{
"sickDayCount": 5,
"notification": "2019/12/01 12:00:00"
}
HTTP status code 200
OK.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 500
Internal server error.
Secured by oauth_2_0
/calendar
Employer or vacation owner only.
delete /calendar/{id}/delete
Employer or vacation owner only.
Accessible with OAuth2 authentication token.
URI Parameters
- id: required(integer)
the calendar's id
HTTP status code 200
OK.
HTTP status code 400
Bad request. Check URI parameters and request body.
HTTP status code 401
Not authenticated.
HTTP status code 403
Not authorized.
HTTP status code 404
Vacation with given ID doesn't exist.
HTTP status code 500
Internal server error.