Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

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

Methods:

GET

...

Table of Contents
minLevel1
maxLevel2

GET

Get workweek schemes list

Returns list of workweek schemes

...

Path

...

.

...

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
title

...

HR

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

Responses:

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

...

Expand
titleExample

...

expand
Path
Path
Code Block
title
GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme
Response 
Response 
Code Block
title
[
  {
    "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"
  }
]

...

title

Get single workweek scheme

Returns information about existing

...

Path

...

workweek

...

scheme

...

.

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
titleHR

Path paramResponses
Name
Type
Description

schemeId

int

Scheme ID

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

Responses:

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

...

Path param

Name

Type

Description

schemeId

int

Scheme ID

Expand
titleExample

...

title
Expand
Path
Path
Code Block
title
GET {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/1
Response 
Response 
Code Block
title
{
  "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

...

.

...

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
titleHR

Query params

Responses
Name
Type
Description

userName

String

User Name

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

Responses:

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed

...

title500

Query params

Name

Type

Description

userName

String

User Name

Expand
titleExample
Path
title
PATH{jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme?userName=user1
Code Block
Path
Response
Response
Code Block
title

...

Expand
titleCreate new workweek scheme

Creates and returns new workweek scheme.

Path

Request /workweek-scheme
Code Block
title
{
  "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 

...

DAY"
}

...

POST 

Create new workweek scheme

Creates and returns new workweek scheme.

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
titleHR

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

Permissions

Status
colourGreen
titleADMIN
 
scheme

Responses:

Status
colour

...

Green
title

...

201
 
Status
colour

...

Yellow
title

...

400
 
Status
colour

...

Red
title

...

500

JSON body fields

Name

Type

Description

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

Status
colourGreen
title201
 
Status
colourYellow
title400
 
Status
colourRed
title500

...

Expand
titleExample
Path
title
POST {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme
Code Block
Path
Body
title
{
  "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"
}
Code Block
Body
Response

...

Expand
titleUpdate workweek scheme

Update and return existing workweek scheme.

PathResponse
Code Block
title
{
  "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

...

_EACH_DAY"
}

...

PATCH

Update workweek scheme

Update and return existing workweek scheme.

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
titleHR

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

Responses:

Status
colourGreen
title

...

200
 
Status
colour

...

Yellow
title

...

400
 
Status
colour

...

Yellow
title

...

404
 
Status
colour

...

Red
title

...

500

Path params

Name

Type

Description

schemeId

int

Scheme ID

JSON body fields

Name

Type

Description

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

...

Status
colourYellow
title400

...

Status
colourRed
title500

...

day

Expand
titleExample
Path
Path
Code Block
title
PATCH {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/2
Body
Body
Code Block
title
 {
  "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

...

Expand
titleAssign workweek scheme to users

Assigns workweek scheme to users.

Path

Code Block
PUT {jira_baseurl}/rest/vacation-manager/1.0/vacmanuser/workweek/bulk
Permissionstitle
{
  "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"
}
Code Block
Response

PUT

...

...

PUT

Assign workweek scheme to users

Assigns workweek scheme to users.

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
titleHR

JSON body fields

Responses
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
Code Block
PUT {jira_baseurl}/rest/vacation-manager/1.0/vacman-user/workweek/bulk

Responses:

Status
colourGreen
title200
 
Status
colour

...

Yellow
title

...

400
 
Status
colourYellow
title

...

404
 
Status
colour

...

Status
colourRed
title500

...

Red
title500

JSON body fields

Name

Type

Description

schemeId

Code Block
Integer

Id of workweek scheme you want to assign to users 

userNames

Code Block
Array<String>

Names of users you want to assign workweek scheme to

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

...

DELETE

...

titleDelete workweek scheme

Deletes existing workweek scheme.

...

Delete workweek scheme

Deletes existing workweek scheme.

Permissions:

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
titleHR

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

Permissions

ADMIN USER SUPERVISOR HR

Path params

Name
Type
Description
schemeIdScheme ID

Responses:

Status
colourGreen
title204
 
Status
colourYellow
title404
 
Status
colourRed
title500

...

Path params

Name

Type

Description

schemeId

int

Scheme ID

Expand
titleExample
Path
Path
Code Block
title
DELETE {jira_baseurl}/rest/vacation-manager/1.0/workweek-scheme/1