Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 1

Overview

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

Methods:

GET

Overview

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

Methods:

GET

Anchor
getTeams
getTeams

Expand
titleGet teams list

Get list of all teams.

Path

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

Permissions

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

Responses

Status
colourGreen
title200
 
Status
colourRed
title500

Example

Expand
title
Path
Example


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


Code Block
titleRequest
code
[
    {
        "id": 1,
        "name": "team 1",
        "description": "description 1"
    },
    {
        "id": 2,
        "name": "team 2",
        "description": "description 2"
    },
    {
        "id": 3,
        "name": "team 3",
        "description": "description 3"
    }
]



Anchor
getTeam
getTeam

Example

Path
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
 
Status
colourGreen
titleHR


Path params

Name
Type
Description
teamIdintTeam ID

Responses

Status
colourGreen
title200
 
Status
colourYellow
title404
 
Status
colour

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

Red
title500


Example

Expand
titleExample


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
    }
  ]
}



Anchor
getTeamMember
getTeamMember

...

Expand
titleGet team members

Get information about existing team.

Path

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

Permissions

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


Path params

Name
Type
Description
teamIdintTeam 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/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": 
1
5,
  
"name
              "userId": 
"teamName",
50,
     
"description
           "role": "
description
SUPERVISOR",
   
"users":
 
[
     
{
       "
id
teamId": 1
			},
			{
     
"name": "user 1",
           "
displayName
id": 
"User 1",
6,
        
"active":
 
true
     
},
  "userId": 60,
 
{
       
"id":
 
2,
       "
name
role": "
user 2
SUPERVISOR",
       
"displayName":
 
"User
 
2",
       "
active
teamId": 
true
1
}
			}
		],
 
{
       "
id
groups":
3,
 [
			{
       
"name":
 
"user
 
3",
       "
displayName
id": 
"User 3"
8,

     
"active":
 
true
     
}
   
],
  "groupName": "supervisors"
:
,
    
[
     
{
       "
id
role": 
4
"SUPERVISOR",
      
"name": "supervisor 1",
          "
displayName
teamId":
"Supervisor 1",
 1
            
"active": true
}
		]
    }
]

}

...

...



POST 

Anchor
createTeam
createTeam

Expand
titleCreate team

Creates new team.

Path

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

Permissions

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


JSON body fields

NameTypeDescription

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

Responses

Status
colourGreen
title201
 
Status
colourYellow
title400
 
Status
colourRed
title500

Example

Expand
Path
titleExample


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


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


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



Anchor
addMember
addMember

Expand
titleAdd member to team

Add member to team.

Path

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


Permissions

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

Path params

Name
Type
Description
teamIdintTeam id


JSON body fields

NameTypeDescription
typeMemberType

Type of member

nameStringName of the member you want to add to the team
roleMemberRole

Role for member

MemberType
NameTypeDescription

USER

Enum

User type

GROUP

EnumGroup type
MemberRole
NameTypeDescription

USER

Enum

User role for member

SUPERVISOR

EnumSupervisor role for member

Responses

Status
colourGreen
title201
 
Status
colourYellow
title400
 
Status
colourYellow
title404
 
Status
colourRed
title500

Example

Expand
title
Path
Example


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

Add user to team

Code Block
titleBody
code
{
	"type":"USER",
	"name":"user 1",
	"role":"USER"
}


Code Block
titleResponse
code
{
    "id": 1,
    "userId": 10000,
    "role": "USER",
    "teamId": 1
}

Add group to

team

team

Code Block
titleBody
code
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}


Code Block
titleResponse
Code Block
{
    "id": 6,
    "groupName": "users",
    "role": "USER",
    "teamId": 1
}



PATCH

Anchor
updateTeam
updateTeam

Expand
titleUpdate team

Update existing team.

Path

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

Permissions

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


Path params

Name
Type
Description
teamIdintTeam ID


JSON body fields

NameTypeDescription

name

String

Team name, must be unique

description

String (Optional)

Team description

Responses

Status
colourGreen
title200
 
Status
colourYellow
title400
 
Status
colourYellow
title404
 
Status
colourRed
title500

Example

Expand
Path
titleExample


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


Code Block
titleBody
code
{
    "name": "new team name"
}


Code Block
titleRequest
code
{
    "id": 1,
    "name": "new team name",
    "description": "Team Description"
}



DELETE

Anchor
deleteTeam
deleteTeam

Expand
titleDelete team

Delete existing team.

Path

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

Permissions

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

Path params

Name
Type
Description
teamIdintTeam ID

Responses

Status
colourGreen
title204
 
Status
colourYellow
title404
 
Status
colourRed
title500

Example

Expand
title
Request
Example


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



Anchor
removeTeamMember
removeTeamMember

Expand
titleRemove member from team

Remove member from team.

Path

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

Permissions

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

Path params

Name
Type
Description
teamIdintTeam ID

JSON body fields

NameTypeDescription
typeString

Type of member to remove

  • USER
  • GROUP
nameStringName of the member you want to remove from the team
roleString

Role for member to remove

  • USER
  • SUPERVISOR

Responses

Status
colourGreen
title204
 
Status
colourYellow
title404
 
Status
colourRed
title500

Example

Path
Expand
titleExample


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


Code Block
titleBody
code
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}