Your account must have the "activity" classification enabled to view activities or activity assignments. Administrators can enable this classification using the web interface.
Activity Managers can view, create and delete any activity assignments. Other users can only view their own assignments.
Show
Request
GET /activity_assignments/#{activity-assignment-id}.xml
Optional parameters
Specify include=users to include user details, and include=activities to include activity details. For example:
GET /activity_assignments/#{activity-assignment-id}.xml?include=users,activities
Response
Status: 200 OK <activity-assignment> <id type="integer">77</id> <created-at type="datetime">2007-03-30T01:37:15Z</created-at> <updated-at type="datetime">2007-12-20T06:55:23Z</updated-at> <!-- if include=users --> <user> ... </user> <!-- else --> <user-id type="integer">24</user-id> <!-- if include=activities --> <activity> ... </activity> <!-- else --> <activity-id type="integer">17</activity-id> </activity-assignment>
List
Request
All activity assignments:
GET /activity_assignments.xml
All active activity assignments:
GET /activity_assignments/active.xml
All inactive activity assignments:
GET /activity_assignments/inactive.xml
Activity assignments for the current user:
GET /activity_assignments/my_assignments.xml
Active activity assignments for the current user:
GET /activity_assignments/my_active_assignments.xml
Inactive activity assignments for the current user:
GET /activity_assignments/my_inactive_assignments.xml
Assignments for a particular activity:
GET /activities/#{activity-id}/assignments.xml
Assignments for a particular user:
GET /users/#{user-id}/activity_assignments.xml
Optional parameters
Specify start and end to request a specific range of items. For example:
GET /activity_assignments.xml?start=1&end=4
Specify include=users to include user details, and include=activities to include activity details. For example:
GET /activity_assignments.xml?include=users,activities
Response
Status: 200 OK <activity-assignments total="11" end="11" start="1"> <activity-assignment> ... </activity-assignment> ... </activity-assignments>
Create
Request
POST /activity_assignments.xml
Include the following data with your request:
<activity-assignment> <!-- user-id (REQUIRED) --> <user-id>#{user-id}</user-id> <!-- activity-id (REQUIRED) --> <activity-id>#{activity-id}</activity-id> </activity-assignment>
Response
Status: 201 Created <activity-assignment> <id type="integer">#{new-activity-assignment-id}</id> <user-id type="integer">25</user-id> <activity-id type="integer">14</activity-id> <created-at type="datetime">2008-01-08T03:47:52Z</created-at> <updated-at type="datetime">2008-01-08T03:47:52Z</updated-at> </activity-assignment>
Delete
Request
DELETE /activity_assignments/#{activity-assignment-id}.xml
Response
Status: 200 OK


