Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Overview

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

Methods:

GET

 Get teams list

Get list of all teams.

Path

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

Permissions

ADMIN USER SUPERVISOR HR

Responses

200 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/team
Request
[
    {
        "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.

Path

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

Permissions

ADMIN USER SUPERVISOR HR


Path params

Name
Type
Description
teamIdintTeam ID

Responses

200 404 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1
Response
{
  "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

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

Permissions

ADMIN USER SUPERVISOR HR

Path params

Name
Type
Description
teamIdintTeam ID

Responses

200 400 500

Example

 Example
Path
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Response
{
    "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 

 Create team

Creates new team.

Path

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

Permissions

ADMIN USER SUPERVISOR HR

JSON body fields

NameTypeDescription

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

Responses

201 400 500

Example

 Example
Path
POST {jira_baseurl}/rest/vacation-manager/1.0/team
Body
{
    "name": "Team name",
    "description": "Team Description"
}
Response
{
	"id": 
    "name": "Team name",
    "description": "Team Description"
}

 Add member to team

Add member to team.

Path

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


Permissions

ADMIN USER SUPERVISOR HR

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

201 400 404 500

Example

 Example
Path
POST {jira_baseurl}/rest/vacation-manager/1.0/team/1/member

Add user to team

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

Add group to team

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

PATCH

 Update team

Update existing team.

Path

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

Permissions

ADMIN USER SUPERVISOR HR


Path params

Name
Type
Description
teamIdintTeam ID


JSON body fields

NameTypeDescription

name

String

Team name, must be unique

description

String (Optional)

Team description

Responses

200 400 404 500

Example

 Example
Path
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/1
Body
{
    "name": "new team name"
}
Request
{
    "id": 1,
    "name": "new team name",
    "description": "Team Description"
}

DELETE

 Delete team

Delete existing team.

Path

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

Permissions

ADMIN USER SUPERVISOR HR

Path params

Name
Type
Description
teamIdintTeam ID

Responses

204 404 500

Example

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

 Remove member from team

Remove member from team.

Path

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

Permissions

ADMIN USER SUPERVISOR HR

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

204 404 500

Example

 Example
Path
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
Body
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}
  • No labels