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

...

Table of Contents
minLevel1
maxLevel2

GET

Get teams list

Get list of all teams.

...

Path

...

...

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

...

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

...

title
Expand


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


Code Block
titleRequest
[
    {
        "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}

Permissions

Status
colourGreen
titleADMIN
 

Responses:

Status
colour

...

Green
title

...

200
 
Status
colour

...

Yellow
title

...

404
 
Status
colour

...

Red
title

...

500

Path params

Name

Type

Description

teamId

int

Team ID

...

Responses

Status
colourGreen
title200

...

Status
colourYellow
title404

...

Example

title500
Expand
titleExample

...

title
Expand


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


Code Block
titleResponse
{
  "id": 1,
  "name": "teamName",
  "description": "description",
  "users": [
    {
      "id": 1,
      "name": "user 1",
      "displayName": "User 1",
      "active": true
    },
    {
      "id": 2,
      "name": "user 2",
      "displayName": "User 2",
      "active": true
    },
    {
      "id": 3,
      "name": "user 3",
      "displayName": "User 3",
      "active": true
    }
  ],
  "supervisors": [
    {
      "id": 4,
      "name": "supervisor 1",
      "displayName": "Supervisor 1",
      "active": true
    }
  ]
}

...



Get team members

Get information about existing team.

...

Path

...

Permissions:

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

Path paramsResponses
Name
Type
Description
teamIdintTeam ID
Code Block
GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member

Responses:

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourRed
title500

...

Path params

Name

Type

Description

teamId

int

Team ID

Expand
titleExample


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


Code Block
titleResponse
{
    "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,
                "role": "SUPERVISOR",
                "teamId": 1
			},
			{
                "id": 6,
                "userId": 60,
                "role": "SUPERVISOR",
                "teamId": 1
			}
		],
        "groups": [
			{
                "id": 8,
                "groupName": "supervisors",
                "role": "SUPERVISOR",
                "teamId": 1
            }
		]
    }
}

POST 

...


...

titleCreate team

Creates new team.

Path

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

...

POST

Create team

Creates new team.

Permissions:

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

JSON body fields

Responses
NameTypeDescription

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

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

Responses:

Status
colourGreen
title201
 
Status
colourYellow
title400
 
Status
colourRed
title500

...

JSON body fields

Name

Type

Description

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

Expand
titleExample

...

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

Body

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

Response

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

...

}

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

...

Enum

...

Responses

Status
colourGreen
title201

...

Status
colourYellow
title400

...

Status
colourRed
title500

...

User role for member

SUPERVISOR

Enum

Supervisor role for member

Expand
titleExample
Path
Code Block

...

titlePath

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

...

PATCH

...

titleUpdate team

Update existing team.

...

": 1
}

...

PATCH

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

Responses

...

Status
colourYellow
title400

...

Status
colourRed
title500

...

description

String (Optional)

Team description

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

...

titleRequest

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

...

DELETE

...

titleDelete team

Delete existing team.

...

 "Team Description"
}

...

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
colourRed

...

title

...

500

Path params

Name

Type

Description

teamId

int

Team ID

Responses 
Expand
title
Example
status
Request
colourGreen
title204
Code Block
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1

Remove member from team

Remove member from team.

Permissions:

Status
colour

...

Green
title

...

ADMIN
 
Status
colourRed
title

...

USER

...

 

...

Status

...

colour

...

Red
title

...

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

...

titleRemove member from team

Remove member from team.

...

SUPERVISOR
 
Status
colourGreen
titleHR

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

Permissions

Status
colourGreen
titleADMIN
 

Responses:

Status
colour

...

Green
title

...

204
 
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

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
 
Status
colourRed
title500

Example

Expand
titleExample
Code Block
titlePath
Expand
titleExample
Path
Code Block
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Body
Body
Code Block
title
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}