Versions Compared

Key

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

Overview

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

Methods

GET

Anchor
getVacationDefinition
getVacationDefinition

Expand
titleGet vacation definition

Returns all vacation definitions for current user or only selected one vacation definition.

Path

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/user/{userName}?vacationTypeId={vacationTypeId}

Permissions

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

Path params

Name

Type

Description

userName

String

User name

Query params

Name

Type

Description

vacationTypeId

int

Vacation type Id

Responses

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

Example

Expand
titleExample


Code Block
titlePath
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/user/userName


Code Block
titleResponse
[
  {
    "id": 1,
    "vacationTypeId": 1,
    "userId": "1",
	"userName": "userName",
    "vacationKindName": "vacation kind name 1",
    "startDate": "2018-10-18",
    "dayLimit": 0
  },
  {
    "id": 2,
    "vacationTypeId": 2,
	"userName": "userName",
    "vacationKindName": "vacation kind name 2",
    "startDate": "2018-10-30",
    "dayLimit": 23
  }
]



Anchor
getVacationDefinitionByID
getVacationDefinitionByID

Expand
titleGet vacation definition with given ID

Returns vacation definition with given ID

Path

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/{vacationDefinitionId}

Permissions

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

Path params

Name

Type

Description

vacationDefinitionId

int

Vacation definition ID

Responses

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

Example

Expand
titleExample


Code Block
titlePath
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/1


Code Block
titleResponse
[
  {
    "id": 1,
    "vacationTypeId": 1,
    "userId": 10000,
    "vacationTypeName": "remote",
    "startDate": "2021-02-01",
    "dayLimit": 0
}
]



Anchor
getVacationInstancesByVacationDefinition
getVacationInstancesByVacationDefinition

Expand
titleGet vacation instances for vacation definition

Returns list of vacation instances for given vacation definition,

Path

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/{vacationDefinitionId}/vacation-instance

Permissions

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

Path params

Name

Type

Description

vacationDefinitionId

int

Vacation definition ID

Responses

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

Example

Expand
titleExample


Code Block
titlePath
GET {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/6/vacation-instance


Code Block
titleResponse
[
  {
    "id": 8,
    "startDate": "2021-01-01",
    "endDate": "2021-01-31",
    "availableDays": 5,
    "availableMinutes": 0,
    "entitledDays": 5,
    "carryOverDays": 0,
    "carryOverMinutes": 0,
    "usedDays": 0,
    "usedMinutes": 0,
    "vacationDocuments": [],
    "vacationDefinitionId": 6,
    "remainingCarryOverDays": 0,
    "remainingCarryOverMinutes": 0
  },
  {
    "id": 9,
    "startDate": "2021-02-01",
    "endDate": "2021-02-28",
    "availableDays": 10,
    "availableMinutes": 0,
    "entitledDays": 5,
    "carryOverDays": 5,
    "carryOverMinutes": 0,
    "usedDays": 0,
    "usedMinutes": 0,
    "vacationDocuments": [],
    "vacationDefinitionId": 6,
    "remainingCarryOverDays": 5,
    "remainingCarryOverMinutes": 0
  },
  {
    "id": 10,
    "startDate": "2021-03-01",
    "endDate": "2021-03-31",
    "availableDays": 5,
    "availableMinutes": 0,
    "entitledDays": 5,
    "carryOverDays": 0,
    "carryOverMinutes": 0,
    "usedDays": 0,
    "usedMinutes": 0,
    "vacationDocuments": [],
    "vacationDefinitionId": 6,
    "remainingCarryOverDays": 0,
    "remainingCarryOverMinutes": 0
  }
]




POST

Anchor
createVacationDefinition
createVacationDefinition

Expand
titleCreate vacation definition

Creates and returns vacation definition.

Path

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

Permissions

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

JSON body fields

Name

Type

Description

vacationTypeId

Integer

vacation type id

userName

String

username to which dew vacation definition will be assigned

startDate

String

Date when user is enabled to request vacation using this definition.  ISO 8601 format.

endDate

String

Date when one time vacation type no longer enables user to request vacation using it. Must be used only when vacation has valid through option enabled. 

 ISO

 ISO 8601 format.

dayLimit

Double

Default day limit. Should be integer when vacation is "daily only" or "daily or hourly". May contain additional half if vacation is "daily or half daily"

Responses

Status
colourGreen
title201
 
Status
colourYellow
title400
 
Status
colourRed
title500

Example

Expand
titleExample


Code Block
titlePath
POST {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition


Code Block
titleBody
{
  "vacationTypeId":"1",
  "userName": "userName",
  "startDate": "2018-09-10",
  "endDate": "2018-09-20",
  "dayLimit": 5
}


Code Block
titleResponse
{
  "id": 8,
  "vacationTypeId": 1,
  "userName": "userName",
  "vacationKindName": "Vacation kind name",
  "startDate": "2018-09-10",
  "endDate": "2018-09-20",
  "dayLimit": 5
}



PUT

Anchor
updateVacationDefinition
updateVacationDefinition

Expand
titleupdate vacation definition

Returns and updates vacation definition.

Path

Code Block
PUT {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/{vacationDefinitionId}

Permissions

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

Path params

Name

Type

Description

vacationDefinitionId

int

Vacation definition ID

JSON body fields

Name

Type

Description

dayLimit

double

Day limit

Responses

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

Example

Expand
titleExample


Code Block
titlePath
PUT {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/2


Code Block
titleBody
{
    "dayLimit": 2
}


Code Block
titleResponse
{
  "id": 2,
  "vacationTypeId": 2,
  "userName": "userName",
  "vacationKindName": "vacation kind name 2",
  "startDate": "2018-10-30",
  "dayLimit": 2
}



DELETE

Anchor
deleteVacationDefinition
deleteVacationDefinition

Expand
titleDelete vacation definition

Deletes vacation definition.

Path

Code Block
delete {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/{vacationDefinitionId}

Permissions

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

Path params

Name

Type

Description

vacationDefinitionId

int

Vacation definition ID

Responses

Status
colourGreen
title204
 
Status
colourYellow
title404
 
Status
colourRed
title500

Example

Expand
titleExample


Code Block
titlePath
DELETE {jira_baseurl}/rest/vacation-manager/1.0/vacation-definition/1



...