Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Overview

Vacation Manager's REST API provides workweek scheme API which allows you to obtain:

Methods:

GET

 Get workweek schemes list

Returns list of workweek schemes.

Path

GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme

Permissions

ADMIN USER SUPERVISOR HR

Responses

200 400 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme
Response 
[
  {
    "id": 1,
    "name": "Default workweek scheme",
    "workweekMinutes": {
      "TUESDAY": 480,
      "SUNDAY": 0,
      "MONDAY": 480,
      "WEDNESDAY": 480,
      "FRIDAY": 480,
      "THURSDAY": 480,
      "SATURDAY": 0
    },
    "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
  },
  {
    "id": 2,
    "name": "Workweek scheme 2",
    "workweekMinutes": {
      "TUESDAY": 480,
      "SUNDAY": 0,
      "MONDAY": 480,
      "WEDNESDAY": 480,
      "FRIDAY": 480,
      "THURSDAY": 480,
      "SATURDAY": 0
    },
    "type": "SAME_WORK_MINUTES_FOR_ALL_DAYS"
  },
  {
    "id": 3,
    "name": "Workweek scheme 3",
    "workweekMinutes": {
      "TUESDAY": 480,
      "SUNDAY": 0,
      "MONDAY": 480,
      "WEDNESDAY": 400,
      "FRIDAY": 480,
      "THURSDAY": 400,
      "SATURDAY": 0
    },
    "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
  }
]

 Get single workweek scheme

Returns information about existing workweek scheme.

Path

GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/{schemeId}

Permissions

ADMIN USER SUPERVISOR HR


Path param

Name
Type
Description

schemeId

int

Scheme ID

Responses

200 400 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/1
Response 
{
  "id": 1,
  "name": "Default workweek scheme",
  "workweekMinutes": {
    "TUESDAY": 480,
    "SUNDAY": 0,
    "MONDAY": 480,
    "WEDNESDAY": 480,
    "FRIDAY": 480,
    "THURSDAY": 480,
    "SATURDAY": 0
  },
  "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
}

 Get workweek scheme for user

Returns workweek scheme used by given user.

Path

GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme?userName={userName}

Permissions

ADMIN USER SUPERVISOR HR

Query params

Name
Type
Description

userName

String

User Name

Responses

200 400 500

Example

 Example
Path
PATH{jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme?userName=user1
Response
{
  "id": 1,
  "name": "Default workweek scheme",
  "workweekMinutes": {
    "TUESDAY": 480,
    "SUNDAY": 0,
    "MONDAY": 480,
    "WEDNESDAY": 480,
    "FRIDAY": 480,
    "THURSDAY": 480,
    "SATURDAY": 0
  },
  "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
}

POST 

 Create new workweek scheme

Creates and returns new workweek scheme.

Path

Request /workweek-scheme
POST {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme

Permissions

ADMIN USER SUPERVISOR HR

JSON body fields

NameTypeDescription

name

String

Workweek scheme name

workweekMinutes

Map<DayOfWeek, Integer>

Day of week : working time in minutes

type

WorkweekSchemeType

Type of work week scheme

DayOfWeek
Name
Type
Description

MONDAY

Enum

Monday

TUESDAY

Enum

Tuesday

WEDNESDAY

Enum

Wednesday

THURSDAY

Enum

Thursday

FRIDAY

Enum

Friday

SATURDAY

Enum

Saturday

SUNDAY

Enum

Sunday

WorkweekSchemeType
Name
Type
Description

SAME_WORK_MINUTES_FOR_ALL_DAYS

Enum

Type of the same work minutes for all days

SEPARATE_WORK_MINUTES_FOR_EACH_DAY

Enum

Type of separate work minutes for each day

Responses

201 400 500

Example

 Example
Path
POST {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme
Body
{
  "name": "Workweek scheme name",
  "workweekMinutes": {
    "FRIDAY": 480,
    "MONDAY": 400,
    "WEDNESDAY": 800,
    "SUNDAY": 0,
    "TUESDAY": 480,
    "SATURDAY": 0,
    "THURSDAY": 400
  },
  "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
}
Response
{
  "id": 101,
  "name": "Workweek scheme name",
  "workweekMinutes": {
    "TUESDAY": 480,
    "SUNDAY": 0,
    "MONDAY": 400,
    "WEDNESDAY": 800,
    "FRIDAY": 480,
    "THURSDAY": 400,
    "SATURDAY": 0
  },
  "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
}

PATCH

 Update workweek scheme

Update and return existing workweek scheme.

Path

PATCH {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/{schemeId}

Permissions

ADMIN USER SUPERVISOR HR

Path params

Name
Type
Description

schemeId

int

Scheme ID


JSON body fields

NameTypeDescription
nameStringWorkweek scheme name
workweekMinutesMap<DayOfWeek, Integer>Day of week : working time in minutes
typeWorkweekSchemeTypeType of work week scheme
DayOfWeek

Name

Type

Description

MONDAY

Enum

Monday

TUESDAY

Enum

Tuesday

WEDNESDAY

Enum

Wednesday

THURSDAY

Enum

Thursday

FRIDAY

Enum

Friday

SATURDAY

Enum

Saturday

SUNDAY

Enum

Sunday

WorkweekSchemeType
Name
Type
Description

SAME_WORK_MINUTES_FOR_ALL_DAYS

Enum

Type of the same work minutes for all days

SEPARATE_WORK_MINUTES_FOR_EACH_DAY

Enum

Type of separate work minutes for each day

Responses

200 400 404 500

Example

 Example
Path
PATCH {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/2
Body
 {
  "name": "Workweek scheme new name",
  "workweekMinutes": {
    "FRIDAY": 480,
    "MONDAY": 400,
    "WEDNESDAY": 800,
    "SUNDAY": 0,
    "TUESDAY": 480,
    "SATURDAY": 0,
    "THURSDAY": 400
  },
  "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
}
Response
{
  "id": 2,
  "name": "Workweek scheme new name",
  "workweekMinutes": {
    "FRIDAY": 480,
    "MONDAY": 400,
    "WEDNESDAY": 800,
    "SUNDAY": 0,
    "TUESDAY": 480,
    "SATURDAY": 0,
    "THURSDAY": 400
  },
  "type": "SEPARATE_WORK_MINUTES_FOR_EACH_DAY"
}

PUT

 Assign workweek scheme to users

Assigns workweek scheme to users.

Path

PUT {jira_baseurl}/rest/vacation-manager/1.0/vacman-user/workweek/bulk

Permissions

ADMIN USER SUPERVISOR HR

JSON body fields

NameTypeDescription
schemeId
Integer
Id of workweek scheme you want to assign to users 
userNames
Array<String>
Names of users you want to assign workweek scheme to

Responses

200 400 404 500

Example

 Example
Path
PUT {jira_baseurl}/rest/vacation-manager/1.0/vacman-user/workweek/bulk
Body
{
   "schemeId": 1,
   "userNames": ["john", "jack"]
}
Response
{  
	"userNames": [
		"john", 
		"jack"
	],
   "schemeId": 1
}

DELETE

 Delete workweek scheme

Deletes existing workweek scheme.

Path

DELETE {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/{schemeId}

Permissions

ADMIN USER SUPERVISOR HR


Path params

Name
Type
Description
schemeIdintScheme ID

Responses

204 404 500

Example

 Example
Path
DELETE {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/1
  • No labels