Teams

This chapter focuses on additional services for the teams. These services extend driven-by-id methods implemented in the Rest Services API by allowing search by Team name.

Get team members

A GET to /teams/team-name/{teamName}/members returns all the members of the team with the given teamName.

Path parameters

Table 1. /api/rest/latest/teams/team-name/{teamName}/members
Parameter Description

teamName

the name of the team

HTTP request

GET /api/rest/latest/teams/team-name/Team%20A/members HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

page

number of the page to retrieve (optional)

size

size of the page to retrieve (optional)

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2102

{
  "_embedded" : {
    "members" : [ {
      "_type" : "user",
      "id" : 1,
      "first_name" : "Charles",
      "last_name" : "Dupond",
      "login" : "User-1",
      "email" : "charlesdupond@aaaa.aa",
      "active" : true,
      "group" : "User",
      "teams" : [ ],
      "last_connected_on" : "2018-02-11T11:00:00.000+0000",
      "created_by" : "admin",
      "created_on" : "2017-07-04T10:00:00.000+0000",
      "last_modified_by" : "admin",
      "last_modified_on" : "2017-07-05T10:00:00.000+0000",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/users/1"
        }
      }
    }, {
      "_type" : "user",
      "id" : 2,
      "first_name" : "Chris",
      "last_name" : "Dupond",
      "login" : "User-2",
      "email" : "chrisdupond@aaaa.aa",
      "active" : true,
      "group" : "User",
      "teams" : [ ],
      "last_connected_on" : "2018-03-11T11:00:00.000+0000",
      "created_by" : "admin",
      "created_on" : "2017-07-04T10:00:00.000+0000",
      "last_modified_by" : "admin",
      "last_modified_on" : "2017-07-05T10:00:00.000+0000",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/users/2"
        }
      }
    }, {
      "_type" : "user",
      "id" : 3,
      "first_name" : "Victor",
      "last_name" : "Dupond",
      "login" : "User-3",
      "email" : "victordupond@aaaa.aa",
      "active" : true,
      "group" : "User",
      "teams" : [ ],
      "last_connected_on" : "2018-03-11T11:00:00.000+0000",
      "created_by" : "admin",
      "created_on" : "2017-07-04T10:00:00.000+0000",
      "last_modified_by" : "admin",
      "last_modified_on" : "2017-07-05T10:00:00.000+0000",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/users/3"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/teams/team-name/Team%20A/members?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 3,
    "totalPages" : 1,
    "number" : 0
  }
}

Response fields

Path Type Description

_embedded.members

Array

the members of this team

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements

page.totalPages

Number

how many pages can be browsed

page.number

Number

the page number

_links

Object

related links

Relation Description

first

link to the first page (optional)

prev

link to the previous page (optional)

self

link to this page

next

link to the next page (optional)

last

link to the last page (optional)

Add members

A POST to /teams/team-name/{teamName}/members with userLogins in request parameters adds these users to the team with the given teamName.

Path parameters

Table 1. /api/rest/latest/teams/team-name/{teamName}/members
Parameter Description

teamName

the name of the team

HTTP request

POST /api/rest/latest/teams/team-name/Team%20A/members HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080

userLogins=John+Doe%2C+Jane+Doe

Request parameters

Parameter Description

userLogins

the logins of the members to add

Remove members

A DELETE to /teams/team-name/{teamName}/members with userLogins in request parameters removes these users from the team with the given teamName.

Path parameters

Table 1. /api/rest/latest/teams/team-name/{teamName}/members
Parameter Description

teamName

the name of the team

HTTP request

DELETE /api/rest/latest/teams/team-name/Team%20A/members HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080

Request parameters

Parameter Description

userLogins

the logins of the members to remove