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

...

titleGet teams list

Get list of all teams.

Path

...

Table of Contents
minLevel1
maxLevel2

GET

Get teams list

Get list of all teams.

Permissions:

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

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

Responses:

Status
colourGreen
title200
 
Status
colourRed
title500

Expand
titleExample

Path

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team
Request
Code Block
[
    {
        "id": 1,
        "name": "team 1",
        "description": "description 1"
    },
    {
        "id": 2,
        "name": "team 2",
        "description": "description 2"
    },
    {
        "id": 3,
        "name": "team 3",
        "description": "description 3"
    }
]

Get single team

Get information about existing team members.

Permissions:

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

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}

Responses:

Status
colourGreen
title200
 
Status
colourYellow
title404
 
Status
colourRed
title500

Path params

Name

Type

Description

teamId

int

Team ID

Expand
titleExample
Path
Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1
Permissions

Response

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

Responses

Status
colourGreen
title200
 
Status
colourRed
title500

Example

Path
Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team
Request
Code Block
Code Block
{
  "id": 1,
  "name": "teamName",
  "description": "description",
  "users": [
    {
        "id": 1,

       "name": "teamuser 1",
 
      "descriptiondisplayName": "descriptionUser 1",
      "active": true
    },
    {
 
      "id": 2,
 
      "name": "teamuser 2",
        "descriptiondisplayName": "descriptionUser 2",
      "active": true
    },
    {
        "id": 3,
        "name": "teamuser 3",

       "descriptiondisplayName": "descriptionUser 3",
      "active": true
    }
  ]

...

Expand
titleGet single team

Get information about existing team members.

Path

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}

Permissions

Status
colourGreen
titleADMIN
 
Status
colourRed
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
,
  "supervisors": [
    {
      "id": 4,
      "name": "supervisor 1",
      "displayName": "Supervisor 1",
      "active": true
    }
  ]
}

Get team members

Get information about existing team.

Permissions:

Status
colourGreen
title

...

ADMIN

...

 

...

Status

...

colour

...

Description

...

teamId

...

int

...

Team ID

Green
titleUSER
 
Status
colourRed
titleSUPERVISOR
 
Status
colourGreen
title

...

HR

Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member

Responses:

Status
colour

...

Green
title

...

Status
colourRed
title500

Example

Path
Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1
Response

...

200
 
Status
colourYellow
title400
 
Status
colourRed
title500

Path params

Name

Type

Description

teamId

int

Team ID

Expand
titleExample
Path
Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Response
Code Block
{
    "id": 1,
    "name": "teamName",
    "description": "description",
    "user": {
        "users": [
			{
                "id": 1,
                "userId": 10,
                "role": "USER",
                "teamId": 1
			},
			{
                "id": 2,
                "userId": 20,
                "role": "USER",
                "teamId": 1
			},
			{
                "id": 3,
                "userId": 30,
                "role": "USER",
                "teamId": 1
			}
		],
        "groups": [
            {
                "id": 7,
                "groupName": "users",
                "role": "USER",
                "teamId": 1
            }
        ]
    },
    "supervisor": {
        "users": [
			{
                "id": 4,
                "userId": 40,
                "role": "SUPERVISOR",
                "teamId": 1
			},
			{
                "id": 5,
                "userId": 50,
                "idrole": 1,"SUPERVISOR",
                "nameteamId": "user 1",1
			},
			{
       "displayName": "User 1",       "activeid": true6,
    },     {       "iduserId": 260,
       "name": "user 2",       "displayNamerole": "User 2SUPERVISOR",
            "active": true   "teamId": 1
			},
  
		],
 {       "idgroups": 3, [
			{
       "name": "user 3",       "displayNameid": "User 3"8,
      "active": true     }   ],
  "groupName": "supervisors":,
    [     {       "idrole": 4"SUPERVISOR",
       "name": "supervisor 1",       "displayNameteamId": "Supervisor 1",
      "active": true     }
		]
     ]
}

...

POST 

...

Expand
titleCreate team

Creates new team.

Path
}
}

...

POST

Create team

Creates new team.

Permissions:

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

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

Permissions

Status
colourGreen
titleADMIN
 

Responses:

Status
colour

...

Green
title

...

201
 
Status
colour

...

Yellow
title

...

400
 
Status
colour

...

Red
title

...

500

JSON body fields

Name

Type

Description

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

Responses

Status
colourGreen
title201
 
Status
colourYellow
title400
  StatuscolourRed Expand
title
500
Example
Path
Code Block
POST {jira_baseurl}/rest/vacation-manager/1.0/team

Body

Code Block
{
    "name": "Team name",
    "description": "Team Description"
}

Response

Code Block
{
	"id": 
    "name": "Team name",
    "description": "Team Description"
}

...

title
Expand

Add member to team

Add member to team.

...

Permissions:

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

Code Block
POST {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member
Permissions

Responses:

Status
colourGreen
title

...

201
 
Status
colour

...

Yellow
title

...

400
 
Status
colour

...

Yellow
title

...

404
 
Status
colour

...

Red
title

...

500

Path params

Name

Type

Description

teamId

int

Team id


JSON body fields

Name

Type

Description

type

MemberType

Type of member

name

String

Name of the member you want to add to the team

role

MemberRole

Role for member

MemberType

Name

Type

Description

USER

Enum

User type

GROUP

Enum

Group type

MemberRole

Name

Type

Description

USER

Enum

User role for member

SUPERVISOR

...

Enum

...

Supervisor role for member

Responses

Status
colourGreen
title201

...

Status
colourYellow
title400

...

Status
colourYellow
title404

...

Enum

Supervisor role for member

Expand
titleExample
Path
Code Block
POST {jira_baseurl}/rest/vacation-manager/1.0/team/1/member

Add user to team

Body
Code Block
{
	"type":"USER",
	"name":"user 1",
	"role":"USER"
}
Response
Code Block
{
    "id": 1,
    "userId": 10000,
    "role": "USER",
    "teamId": 1
}

Add group to team

Body
Code Block
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}
Response
Code Block
{
    "id": 6,
    "groupName": "users",
    "role": "USER",
    "teamId": 1
}

...

PATCH

...

titleUpdate team

Update existing team.

...

Update team

Update existing team.

Permissions:

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

Code Block
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}
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

teamId

int

Team ID


JSON body fields

Name

Type

Description

name

String

Team name, must be unique

description

String (Optional)

Team description

...

allowUsersViewStatistics

Status
colourGreen
title200

...

Status
colourYellow
title400

...

Status
colourYellow
title404

...

bool

(Optional)

as name says, it’s boolean value that can be either true or false,

defaultSupervisorId

int

(Optional)

ID (number value - not user name!) of a user that will be set as default supervisor, -1 means that this value will be cleared and default supervisor will be removed from team.

Expand
titleExample
Path
Code Block
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/1
Body
Code Block
{
    "name": "new team name"
}
Request
Code Block

...

{
    "id": 1,
    "name": "new team name",
    "

...

description": "Team 

...

Description",
    "

...

allowUsersViewStatistics":

...

false,
    "

...

defaultSupervisorId": 

...

DELETE

...

titleDelete team

Delete existing team.

...

10101
}

...

DELETE

Delete team

Delete existing team.

Permissions:

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

Code Block
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}
Permissions

Responses:

Status
colourGreen
title

...

204
 
Status
colour

...

Yellow
title

...

404
 
Status
colour

...

Red
title

...

500

Path params

Name

Type

Description

teamId

int

Team ID

...

Expand
titleExample
Request
Code Block
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1

Remove member from team

Remove member from team.

Permissions:

Status
colourGreen
title

...

ADMIN
 
Status
colour

...

Red
title

...

USER
 
Status
colourRed
title

...

SUPERVISOR

...

 

...

titleRemove member from team

Remove member from team.

Path

Status

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

...

colourGreen
titleHR

Code Block
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member
Permissions

Responses:

Status
colourGreen
title

...

204
 
Status
colour

...

Yellow
title

...

404
 
Status
colourRed
title

...

500

Path params

Name

Type

Description

teamId

int

Team ID

JSON body fields

Name

Type

Description

type

String

Type of member to remove

  • USER

  • GROUP

name

String

Name of the member you want to remove from the team

role

String

Role for member to remove

  • USER

  • SUPERVISOR

Responses

Status
colourGreen
title204
 
Status
colourYellow
title404
  StatuscolourRedtitle500 Expand
titleExample
Path
Code Block
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Body
Code Block
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}