Managing user groups
A user group is a logical grouping of users that can be assigned privileges for files and folders. The REST API can manage user groups using the /usergroups resource. Only members of the Administrators user group can use this resource. The following sections provide an example of using each usergroups resource as a curl command.
GET usergroups
This example requests the list of user groups:
GET /ihub/v1/usergroups HTTP/1.1
host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the list of user groups in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/usergroups ‑H "AuthId:%RESTAuthId%"
GET usergroups/{groupId}
This example requests the user group details for the user group with group ID 100000000100:
GET /ihub/v1/usergroups/100000000100 HTTP/1.1
host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the user group details for the user group with user group ID 100100000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/usergroups/100100000100 ‑H "AuthId:%RESTAuthId%"
POST usergroups
This example creates the new user group dahl:
POST /ihub/v1/usergroups HTTP/1.1
Host: myserver.mycompanyname.com:5000
Content-Type: application/x-www-form-urlencoded
AuthId: <authId>
 
name=dahl
This curl example sends a POST request to iHub to create the user group Sales in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/usergroups ‑H "AuthId:%RESTAuthId%" ‑d name=Sales ‑d email="salesadmin@mycompanynamehere.com" ‑d description="Sales Department"
PUT usergroups/{groupId}
This example changes the description for the user group with group ID 100000000100:
PUT /ihub/v1/usergroups/100000000100 HTTP/1.1
Host: myserver.mycompanyname.com:5000
Content-Type: application/x-www-form-urlencoded
AuthId: <authId>
 
description=A%20user%20group%20for%20testing%20user%20group
%20requests
This curl example sends a PUT request to iHub to modify the name, e‑mail address, and members of the user group with the user group ID 200100000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/usergroups/200100000100 ‑X PUT ‑H "AuthId:%RESTAuthId%" ‑d name="North America Sales" ‑d email="NAsalesadmin@mycompanynamehere.com" ‑d addUser=100100000100
DELETE usergroups/{groupId}
This example deletes the group with group ID 100000000100 when combined with a DELETE method:
DELETE /ihub/v1/users/100000000100 HTTP/1.1
Host: myserver.mycompanyname.com:5000
Content-Type: application/json; charset=utf-8
AuthId: <authId>
This curl example sends a DELETE request to iHub to delete the user group with user group ID 200100000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/usergroups/200100000100 ‑X DELETE ‑H "AuthId:%RESTAuthId%"
GET usergroups/{groupId}/users
This example requests the list of users that are members of the user group with user group ID 200000000100:
GET /ihub/v1/usergroups/200000000100/users HTTP/1.1
host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the list of users that are members of the user group with the user group ID 100100000100 in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/usergroups/100100000100
/users ‑H "AuthId:%RESTAuthId%"