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 6 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

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

teamId

int

Team ID

Responses

200 404 500


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



POST 

 Create team

Creates new team.

Path

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

Permissions

ADMIN USER SUPERVISOR HR


JSON body fields

Name

Type

Description

name

String

Team name, must be unique for each team

description

String (Optional)

Team description

Responses

201 400 500

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

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

201 400 404 500

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

teamId

int

Team ID


JSON body fields

Name

Type

Description

name

String

Team name, must be unique

description

String (Optional)

Team description

Responses

200 400 404 500

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

teamId

int

Team ID

Responses

204 404 500

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

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

204 404 500

Example

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


Body
{
	"type":"GROUP",
	"name":"users",
	"role":"USER"
}







  • No labels