You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 2 Next »
Vacation Manager's REST API provides team API which allows you to obtain:
create new team
add member to team
update team
delete team
remove member from team
get teams list
get single team
get team members
Get list of all teams.
GET {jira_baseurl}/rest/vacation-manager/1.0/team
ADMIN USER SUPERVISOR HR
200 500
[ { "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 information about existing team members.
GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}
Name
Type
Description
teamId
int
Team ID
200 404 500
Example
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1
{ "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 information about existing team.
GET {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member
200 400 500
GET {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
{ "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 } ] } }
Creates new team.
POST {jira_baseurl}/rest/vacation-manager/1.0/team
name
String
Team name, must be unique for each team
description
String (Optional)
Team description
201 400 500
{ "name": "Team name", "description": "Team Description" }
{ "id": "name": "Team name", "description": "Team Description" }
Add member to team.
POST {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member
Team id
JSON body fields
type
MemberType
Type of member
Name of the member you want to add to the team
role
MemberRole
Role for member
USER
Enum
User type
GROUP
Group type
User role for member
SUPERVISOR
Supervisor role for member
201 400 404 500
POST {jira_baseurl}/rest/vacation-manager/1.0/team/1/member
{ "type":"USER", "name":"user 1", "role":"USER" }
{ "id": 1, "userId": 10000, "role": "USER", "teamId": 1 }
{ "type":"GROUP", "name":"users", "role":"USER" }
{ "id": 6, "groupName": "users", "role": "USER", "teamId": 1 }
Update existing team.
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}
Team name, must be unique
200 400 404 500
PATCH {jira_baseurl}/rest/vacation-manager/1.0/team/1
{ "name": "new team name" }
{ "id": 1, "name": "new team name", "description": "Team Description" }
Delete existing team.
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}
204 404 500
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1
Remove member from team.
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/{teamId}/member
Type of member to remove
Name of the member you want to remove from the team
Role for member to remove
DELETE {jira_baseurl}/rest/vacation-manager/1.0/team/1/member