Activities
Activities provide a secondary way of classifying your time entries independent of jobs.
You can check if activities are enabled using the Account Information interface (account / time-settings / show-activities). Administrators can enable activities from Syncd's web interface via Settings / Time Tracking.
Activity Managers can view, create, update and delete activities. Other users can only view their assigned activities.
Show
Request
GET /activities/#{activity-id}.xmlResponse
1 Status: 200 OK 2 3 <activity> 4 <id type="integer">14</id> 5 <name>Client interview</name> 6 <active type="boolean">true</active> 7 <code>INT</code> 8 <description>Non-billable introductory interview</description> 9 <url/> 10 <!-- if include=timestamps --> 11 <created-at type="datetime">2007-08-16T20:49:05Z</created-at> 12 <updated-at type="datetime">2008-07-12T13:30:38Z</updated-at> 13 <!-- end --> 14 </activity>
List
Request
All activities:
GET /activities.xml
All active activities:
GET /activities/active.xml
All inactive activities:
GET /activities/inactive.xml
Activities assigned to the current user:
GET /activities/my_assignments.xml
Active activities assigned to the current user:
GET /activities/my_active_assignments.xml
Inactive activities assigned to the current user:
GET /activities/my_inactive_assignments.xml
Optional parameters
Specify start and end to request a specific range of items. For example:
GET /activities.xml?start=1&end=4
Response
1 Status: 200 OK 2 3 <activities type="array"> 4 <activity> 5 ... 6 </activity> 7 ... 8 </activities>
Create
Request
POST /activities.xml
Include the following data with your request:
1 <activity> 2 <!-- name (required, unique, max-length=50) --> 3 <name>Client interview</name> 4 <!-- active (optional boolean, default=true) --> 5 <active>true</active> 6 <!-- code (optional identifier, max-length=50) --> 7 <code>INT</code> 8 <!-- description (optional, max-length=255) --> 9 <description>Non-billable introductory interview</description> 10 <!-- url (optional external link, max-length=255) --> 11 <url></url> 12 </activity>
Response
1 Status: 201 Created 2 3 <activity> 4 <id type="integer">#{new-activity-id}</id> 5 <name>Client interview</name> 6 <active type="boolean">true</active> 7 <code>INT</code> 8 <description>Non-billable introductory interview</description> 9 <url></url> 10 </activity>
Update
Request
PUT /activities/#{activity-id}.xmlInclude ANY of the following data with your request:
1 <activity> 2 <name>Client interview</name> 3 <active>true</active> 4 <code>INT</code> 5 <description>Non-billable introductory interview</description> 6 <url></url> 7 </activity>
Response
Status: 200 OK
Delete
Activities associated with time entries can not be deleted. Instead, deactivate them (update the activity, setting active to false).
Request
DELETE /activities/#{activity-id}.xmlResponse
Status: 200 OK

