- WorkTrail API /
- Tasks & Projects
Tasks & Projects
In WorkTrail tasks and projects are very intervened. Although the UI no longer displays it this way - every task has to be part of exactly one project. This means that apps have to fetch projects if they intend to work with tasks. Required scope: read-tasks (Since projects and tasks depend on each other, there are no separate scopes)
Projects Request URL
https://worktrail.net/rest/projects/
Project Object
The above URL returns a list as described inĀ Request Basics, in the list property the following objects will be available:
{ "id": 123, "name": "Project Name", "state": "open", (contains one of: template,open,pending,cancelled or done) "modifydate": 1328191523 }
Tasks Request URL
https://worktrail.net/rest/tasks/
Task Object
The following object will be returned in the list:
{ "id": 123, "project_id": 123, "summary": "My task's summary", "state": "open", (one of: draft,open,pending,cancelled,done) "time_effective": 100, (total work time which was effectively tracked by any employee in seconds) "time_planned": 14400, (initial planned time for this task in seconds - is only changed when this task is in draft mode) "time_total": 14400, (total time planned for this task in seconds) "modifydate": 1328194928 (timestamp when this task was changed) }
- time_effective: The time which was already booked on this task, in seconds.
- time_planned: Time which was originally planned for this task (first estimation), in seconds.
- time_total: Current estimation for a task, in seconds.
Creating new Projects
Requires the scope write-tasks.
Send a POST request to https://worktrail.net/rest/projects/create/ with a POST attribute called "project" containing a json object with the following structure:
{ "name": "Name of new project", "state": "open" }
Will return a JSON object of the format: { "status": "success", "id": 123 } with "id" containing the new internal ID of the given project.
Changing existing projects
The same POST request as above but to https://worktrail.net/rest/projects/update/ with an additional "id" property in the project object.
Creating new Tasks
Requires the scope write-tasks.
Send a POST request to https://worktrail.net/rest/tasks/create/ with a POST attribute called 'task' which contains the following JSON encoded object:
{ "project_id": 123 "summary": "Task summary", "description": "longer description of this task", "state": "open" }
Will return a JSON object contain { "success": true, "id": 123 } - the ID will contain the internal id of the newly created task.