Work with tracks

Add track

Request:

{
    "server_token": "...",
    "app_version": "...",
    "controller": "WorkspaceActionController",
    "query": {
        "action": "insert",
        "domain": "task_timings",
        "params": {
            "record": {
                "task_id": 17,
                "employee_id": 1,
                "project_id": 1,
                "priority": 0,
                "begin": 1479283838,
                "end": 1479370245,
                "comment": "Comment to task"
            }
        }
    }
}
task_idTask’s ID
employee_idEmployee's ID, for which the track is created
project_idProject’s ID
priorityThe priority of the added track. It affects the way that the added track will superimpose on the existing or not. The track with higher priority superimpose on the tracks with lower. Possible values are 0 or 2. The track with a priority 1 can't be added through API.
beginThe start time of the track (in UTC)
endThe stop time of the track (in UTC)
commentText comment to the track

Time must be specified in UTC in seconds. Values must be an integer, non-negative and the start time of the track should be less than the time of the end.

Response:

{"result":{"affected_ids":[1]}}

Edit track

Request:

{
    "server_token": "...",
    "app_version": "...",
    "controller": "WorkspaceActionController",
    "query": {
        "action": "update",
        "domain": "task_timings",
        "params": {
            "filter": {
                "task_timing_id": 1 or [1]
            },
            "record": {
                "task_id": 17,
                "project_id": 1,
                "begin": 1479283838,
                "end": 1479370245,
                "comment": "Comment to task"
            }
        }
    }
}
task_timing_idTrack’s ID which needs to be edited. You can also pass an array of IDs as the value for mass editing.
task_idTask’s ID
project_idProject’s ID
beginThe start time of the track (in UTC)
endThe stop time of the track (in UTC)
commentText comment to the track

In the record parameter you can set only that field which needs to be changed (all fields not necessary to send).
Time must be specified in UTC in seconds. Values must be an integer, non-negative and the start time of the track should be less than the time of the end.
This way it is possible to edit only the tracks added through Web API.

Response:

{"result":{"affected_ids":[1]}}

Remove track

Request:

{
    "server_token": "...",
    "app_version": "...",
    "controller": "WorkspaceActionController",
    "query": {
        "action": "remove",
        "domain": "task_timings",
        "params": {
            "filter": {
                "task_timing_id": 1 or [1]
            }
        }
    }
}
task_timing_idTrack ID, which must be removed. You can also pass an array of IDs as the value for the mass removal.

This way you can only delete tracks added through Web API.

Response:

{"result":{"affected_ids":[1]}}