' RestAPI Tasks | WebWork Time Tracker

Tasks


Use WebWork API to simply get all the tasks in the portal for the logged in user, edit or delete them, and create new ones. You can get all the tasks in the given project, update and delete them and also get all the details for the specific task. There is not any limitation in our API, all actions available in WebWork are possible to do through the API.

GET All Tasks


You can get all the tasks in your account with the following URL request

Copy codeGEThttps://www.webwork-tracker.com/rest-api/tasks

It is also possible to get all the tasks of the specific project by giving project_id parameter to the URL, as shown in the example.

Copy codeGEThttps://www.webwork-tracker.com/rest-api/tasks?project_id={project_id}

The response should return in a json format. An example of response structure find below.

                Copy code
                [
                    {
                        "id": "{task_id}"
                        "creator_id": "{creator_id}"
                        "owner_id": "{owner_id}"
                        "project_id": "{project_id}"
                        "title": "{title}"
                        "description": "{description}"
                        "status": "{status}"
                        "priority": "{priority}"
                        "completed_at": "{completed_at}"
                        "start_date": "{start_date}"
                        "end_date": "{end_date}"
                        "has_details": "{has_details}"
                        "created_at": "{created_at}"
                        "updated_at": "{updated_at}"
                        "deleted_at": "{deleted_at}"
                    },
                    {...}
                ]
            

GET One task


If you need to get information regarding a specific task, you need to add the {task_id} at the end of the URL

Copy codeGEThttps://www.webwork-tracker.com/rest-api/tasks/{task_id}

The response returns in a json format. Below you can see an example of response structure.

                Copy code
                {
                    "id": "{task_id}"
                    "creator_id": "{creator_id}"
                    "owner_id": "{owner_id}"
                    "project_id": "{project_id}"
                    "title": "{title}"
                    "description": "{description}"
                    "status": "{status}"
                    "priority": "{priority}"
                    "completed_at": "{completed_at}"
                    "start_date": "{start_date}"
                    "end_date": "{end_date}"
                    "has_details": "{has_details}"
                    "created_at": "{created_at}"
                    "updated_at": "{updated_at}"
                    "deleted_at": "{deleted_at}"
                }
            

PUT Update task


Update a task by sending a PUT method request to the following URL and adding appropriate parameters.
The URL must include task_id

Copy codePUThttps://www.webwork-tracker.com/rest-api/tasks/{task_id}

You should put the following header in your request

Copy codeContent-Type: application/x-www-form-urlencoded

Using PUT method you can update task title, description, status, start date, end date and priority.

Property name Type Is required
title string YES
description string NO
status integer NO
start_date date NO
end_date date NO
priority integer NO

The list of available values you can see below

Property name Value Explanation
status 10 To do
status 20 Doing
status 30 Done
priority 10 Urgent
priority 20 High
priority 30 Normal

The returned response contains a success property with your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }
            

POST Create task


You can create a new task using POST method and adding all necessary parameters to request body.

Copy codePOSThttps://www.webwork-tracker.com/rest-api/tasks

Below you can see all parameters that you can pass to request body

Property name Type Is required
title string YES
project_id integer YES
priority integer NO

The list of available values you can see below

Property name Value Explanation
priority 10 Urgent
priority 20 High
priority 30 Normal

The returned response includes a success property which contains your request success value, and task property which is an array of the created task options.

                Copy code
                {
                    "success": "{success_of_the_request}"
                    "task": "{task_array}"
                }
            

In case of failure the response will include only success property.

DELETE Delete task


In order to delete a task you should send a request to the same URL using DELETE method and adding {task_id} property at the end of it. See an example below.

Copy codeDELETEhttps://www.webwork-tracker.com/rest-api/tasks/{task_id}

The returned response includes a success property which contains your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }
            

GET Create assignee


Through task API you can also simply assign a task to a specific user by sending a GET request to the following URL and adding {task_id} and {user_id} parameters.

Please, note that the user should already have contacts in the project in order you can assign tasks.

Copy codeGEThttps://www.webwork-tracker.com/rest-api/tasks/assign/{task_id}/{user_id}

The returned response includes a success property which contains your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                    "assignee": "{assignee_info}"
                }
            

GET Remove assignee


Unassign users can be done the same way as assigning them, just use URL mentioned below and add appreciate parameters.

Copy codeGEThttps://www.webwork-tracker.com/rest-api/tasks/unassign/{task_id}/{user_id}

The returned response includes a success property which contains your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }