Syncd API
User Group Memberships
Only User Group Managers can view, create and delete user group memberships.
Show
Request
GET /user-group-memberships/#{user-group-membership-id}.xml
Optional parameters
The following optional parameters can be used to include extra data:
include=[users, user_groups]
Response
Status: 200 OK <user-group-membership> <id type="integer">#{user-group-membership-id}</id> <!-- if include=users --> <user> ... </user> <!-- else --> <user-id type="integer">#{user-id}</user-id> <!-- end --> <!-- if include=user_groups --> <user-group> ... </user-group> <!-- else --> <user-group-id type="integer">#{user-group-id}</user-group-id> <!-- end --> <!-- if include=timestamps --> <created-at type="datetime">2008-01-08T03:47:52Z</created-at> <updated-at type="datetime">2008-01-08T03:47:52Z</updated-at> <!-- end --> </user-group-membership>
List
Request
All user group memberships:
GET /user-group-memberships.xml
Memberships for a particular user:
GET /users/#{user-id}/user-group-memberships.xml
Memberships for a particular user group:
GET /user_groups/#{user-group-id}/user-group-memberships.xml
Optional parameters
Specify start
and end
to request a specific range of items. For example:
GET /user-group-memberships.xml?start=1&end=4
The following optional parameters can be used to include extra data:
include=[users, user_groups]
For example:
GET /user-group-memberships.xml?include=users,user_groups
Response
Status: 200 OK <user-group-memberships type="array"> <user-group-membership> ... </user-group-membership> ... </user-group-memberships>
Create
Request
POST /user-group-memberships.xml
Include the following data with your request:
<user-group-membership> <user-id>#{user-id}</user-id> <user-group-id>#{user-group-id}</user-group-id> </user-group-membership>
Response
Status: 201 Created <user-group-membership> <id type="integer">#{new-user-group-membership-id}</id> <user-id type="integer">25</user-id> <user-group-id type="integer">14</user-group-id> <!-- if include=timestamps --> <created-at type="datetime">2008-01-08T03:47:52Z</created-at> <updated-at type="datetime">2008-01-08T03:47:52Z</updated-at> <!-- end --> </user-group-membership>
Delete
Request
DELETE /user-group-memberships/#{user-group-membership-id}.xml
Response
Status: 200 OK