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



Anchor
getTeam
getTeam


Example

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

Example

expand

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

...

 
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": 5, "userId": 50, "role": "SUPERVISOR", "teamId": 1 }, { "id": 6, "userId": 60, "role": "SUPERVISOR", "teamId": 1 } ], "groups": [ { "id": 8, "groupName": "supervisors", "role": "SUPERVISOR",
,
      "
teamId
displayName": "Supervisor 1",
      "active": true
    }
]
  ]
}
}



Anchor
getTeamMember
getTeamMember

POST 

Anchor
createTeam
createTeam

title

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

Example

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


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


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

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

Add user to team

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


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


Add group to team

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


Code Block
titleResponse
{
    "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
titleExample
Code Block
titlePath
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/1


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


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




DELETE

Anchor
deleteTeam
deleteTeam

title

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

Example

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



Anchor
removeTeamMember
removeTeamMember

title

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

Expand

Example

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


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