# Group controller (/group)

This controller contains endpoints to manage groups of users. Groups give permissions to its members with respect to each other.

Endpoints in alphabetical order:

/group/ (GET)
/group/ (POST)
/group/ (DELETE)
/group/member (POST)
/group/member (DELETE)

# / (GET)

/group/ GET
Description
Returns the group and its members for the specified group name. The members are returned as a short user profile with name details. Complete user profiles can be obtained with

GET /user/

.

Note that patients receive short user profiles of all their group members, but they cannot get the complete user profile of other users than themselves.

Authorization
Admins can call this endpoint for any group. Other users must be a member of the requested group.
URL parameters
name
Group name (formatted as an email address)
includeInactive-
Members
(optional) true if you want to include inactive members, false if you only want to get active members. The default is true.
Content
Response (application/json)
JSON object with the following properties.
name
Group name (formatted as an email address)
members
JSON array with user objects for the members (see below).
A user object has the following properties. All properties except userid and role may be null.
userid
User ID. This is always set. It identifies a user in SenSeeAct.
role
PATIENT, PROFESSIONAL, ADMIN. This is always set.
gender
MALE, FEMALE, OTHER
title
Title
initials
Initials of the first names formatted as A.B.C.
firstName
First name. This should be the familiar first name used to address the person in friendly language.
prefixes
Prefixes for the last name. Languages such as Dutch have prefixes for last names that should be ignored when sorting.
lastName
Last name. This should be the familiar last name used to address the person in friendly language.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/group/
    ?name=group@example.com
    &includeInactiveMembers=true
X-Auth-Token: ...
Response
{
    "name": "group@example.com",
    "members":[
        {
            "userid": "b43f784d76c44e7a9ae0370b91521753",
            "role": "PATIENT",
            "gender": null,
            "title": null,
            "initials": null,
            "firstName": null,
            "prefixes": null,
            "lastName": null
        },
        ...
    ]
}

# / (POST)

/group/ POST
Description
Creates a new group. You can optionally add group members. Professionals in the group gain access to all other group members.

Note that all group members, including patients, can get the short user profiles of other members through

GET /group/

, even if they cannot get the complete user profiles with

GET /user/

.

Authorization
Only admins can call this endpoint.
URL parameters
name
Group name (formatted as an email address)
Content (application/json)
You can leave the content empty or specify the group members in a JSON object with the following property.
members
JSON array with the user IDs of the group members
Response (application/json)
Errors
If a group with the same name already exists.
HTTP status
403 Forbidden
Code
GROUP_ALREADY_EXISTS
Field errors
name
Example
Request
POST https://www.example.com/servlets/senseeact/v6.1.0/group/
    ?name=group@example.com
X-Auth-Token: ...
 
{
    "members": [
        "b43f784d76c44e7a9ae0370b91521753",
        ...
    ]
}
Response

# / (DELETE)

/group/ DELETE
Description
Deletes a group.
Authorization
Only admins can call this endpoint.
URL parameters
name
Group name (formatted as an email address)
Content
Response
Example
Request
DELETE https://www.example.com/servlets/senseeact/v6.1.0/group/
    ?name=group@example.com
X-Auth-Token: ...
Response

# /member (POST)

/group/member POST
Description
Adds a member to a group. Professionals in the group gain access to all other group members. If the user is already a member, then this endpoint has no effect.

Note that all group members, including patients, can get the short user profiles of other members through

GET /group/

, even if they cannot get the complete user profiles with

GET /user/

.

Authorization
Only admins can call this endpoint.
URL parameters
group
Group name (formatted as an email address)
member
User ID of the user to add as a member
Content
Response
Example
Request
POST https://www.example.com/servlets/senseeact/v6.1.0/group/member
    ?group=group@example.com
    &member=b43f784d76c44e7a9ae0370b91521753
X-Auth-Token: ...
Response

# /member (DELETE)

/group/member DELETE
Description
Deletes a member from a group. If the specified user is not a member, then this endpoint has no effect.
Authorization
Only admins can call this endpoint.
URL parameters
group
Group name (formatted as an email address)
member
User ID of the user to delete from the group
Content
Response
Example
Request
DELETE https://www.example.com/servlets/senseeact/v6.1.0/group/member
    ?group=group@example.com
    &member=b43f784d76c44e7a9ae0370b91521753
X-Auth-Token: ...
Response