Syncd API
User Groups
User Groups are used to streamline assignments for multiple users.
User Group Managers can view, create, update and delete user groups. Job Managers and Activity Managers can only view user groups.
Show
Request
GET /user-groups/#{user-group-id}.xml
Response
Status: 200 OK <user-group> <id type="integer">#{user-group-id}</id> <name>Administrators</name> <code>ADMIN</code> <description>Users with full privileges</description> <url>http://intranet/users/admins</url> <!-- if include=timestamps --> <created-at type="datetime">2007-08-16T20:49:05Z</created-at> <updated-at type="datetime">2008-07-12T13:30:38Z</updated-at> <!-- end --> </user-group>
List
Request
All user groups:
GET /user_groups.xml
A user's groups (via User Group Memberships):
GET /users/#{user-id}/user_groups.xml
Optional parameters
Specify start
and end
to request a specific range of items. For example:
GET /user_groups.xml?start=1&end=2
Response
Status: 200 OK <user-groups type="array"> <user-groups> ... </user-group> ... </user-groups>
Create
Request
POST /user-groups.xml
Include the following data with your request:
<user-group> <!-- name (required, unique, max-length=50) --> <name>Administrators</name> <!-- code (optional identifier, max-length=50) --> <code>ADMIN</code> <!-- description (optional, max-length=255) --> <description>Users with full privileges</description> <!-- url (optional external link, max-length=255) --> <url>http://intranet/users/admins</url> </user-group>
Response
Status: 201 Created <user-group> <id type="integer">#{new-user-group-id}</id> <name>Administrators</name> <code>ADMIN</code> <description>Users with full privileges</description> <url>http://intranet/users/admins</url> <!-- if include=timestamps --> <created-at type="datetime">2007-08-16T20:49:05Z</created-at> <updated-at type="datetime">2008-07-12T13:30:38Z</updated-at> <!-- end --> </user-group>
Update
Request
PUT /user-groups/#{user-group-id}.xml
Include ANY of the following data with your request:
<user-group> <name>Administrators</name> <code>ADMIN</code> <description>Users with full privileges</description> <url>http://intranet/users/admins</url> </user-group>
Response
Status: 200 OK
Delete
When a user group is deleted, all of its associated job and activity assignments and user memberships are automatically deleted too.
Request
DELETE /user-groups/#{user-group-id}.xml
Response
Status: 200 OK