D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

GroupManager Resource

Manages groups

GET /groups

Get list of the groups for the current user

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Response Codes
code condition
200 Success.
Response Body
media type data type description
application/json array of string (JSON) list of groups

Example

Request
GET /groups
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /groups

Create a new group
Only users with Infrastructure-Manager role allowed

Request Parameters
name type description
accessType form access type
Possible values: READ_ONLY, WRITE_OWNER, WRITE_ALL, ADMINISTRATOR
folderOwner form folder owner
group form group name
useDefaultStorage form use default storage if true
Possible values: true, false
Optional default: true
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
Request Body
media type data type
multipart/form-data (custom)
Response Codes
code condition
200 Success.
403 You're not allowed to create groups.
406 Error creating group.
415 Wrong content type.
Response Body
media type data type description
text/plain string group name

Example

Request
POST /groups
Content-Type: multipart/form-data
Accept: text/plain
Authorization: ...

--------boundaryString
Content-Disposition: form-data; name="group"

my_group
--------boundaryString
Content-Disposition: form-data; name="accessType"

ADMINISTRATOR
--------boundaryString
Content-Disposition: form-data; name="folderOwner"

user1
--------boundaryString
Content-Disposition: form-data; name="useDefaultStorage"

true
--------boundaryString--

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
"group"
                
              

GET /groups/{groupId}/admins

Get the list of administrators of a group

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
groupId path group name
Response Codes
code condition
200 Success.
406 This group does not exist.
Response Body
media type data type description
application/json array of string (JSON) list of administrators

Example

Request
GET /groups/{groupId}/admins
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /groups/{groupId}/users

Get the list of users of a group
Only users with Infrastructure-Manager or VRE-Manager role allowed

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
groupId path group name
Response Codes
code condition
200 Success.
406 Group does not exist.
Response Body
media type data type description
application/json array of string (JSON) list of users

Example

Request
GET /groups/{groupId}/users
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

DELETE /groups/{groupId}/users/{userId}

Remove a user from a group
Only users with Infrastructure-Manager or VRE-Manager role allowed

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
groupId path group name
userId path user name
Response Codes
code condition
200 Success.
403 You're not allowed to add users to groups.
406 Group or user does not exist.
Response Body
media type data type description
application/json boolean (JSON) true if the user has been removed from the group

Example

Request
DELETE /groups/{groupId}/users/{userId}
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

DELETE /groups/{group}

Delete a group
Only users with Infrastructure-Manager role allowed

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
group path group name
Response Codes
code condition
200 Success.
403 You're not allowed to delete groups.
406 Error deleting group.
Response Body
media type data type description
text/plain string group name

Example

Request
DELETE /groups/{group}
Content-Type: */*
Accept: text/plain
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
"group"
                
              

PUT /groups/{id}/admins

Add an administrator to a group

Request Parameters
name type description
userId form user name
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path group name
Request Body
media type data type
application/x-www-form-urlencoded (custom)
Response Codes
code condition
204 Success.
406 Error adding an admin.
415 Wrong content type.
Response Body
media type data type description
application/json string (JSON)

Example

Request
PUT /groups/{id}/admins
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

DELETE /groups/{id}/admins/{userId}

Remove an administrator from a group. The removed admin remains in the group as a normal user.

Request Parameters
name type description
userId form user name
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path group name
Response Codes
code condition
204 Success.
406 Error removing an admin.
415 Wrong content type.
Response Body
media type data type description
application/json object (JSON)

Example

Request
DELETE /groups/{id}/admins/{userId}
Content-Type: */*
Accept: application/json
Authorization: ...

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

PUT /groups/{id}/users

Add a user to a group
Only users with Infrastructure-Manager or VRE-Manager role allowed

Request Parameters
name type description
userId form user name
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
id path group name
Request Body
media type data type
application/x-www-form-urlencoded (custom)
Response Codes
code condition
200 Success.
403 You're not allowed to add users to groups.
406 Group or user does not exist.
415 Wrong content type.
Response Body
media type data type description
application/json boolean (JSON) true if the user has been added to the group

Example

Request
PUT /groups/{id}/users
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: ...

userId=user1


                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...