• FAQ
  • API
  • Costs
  • Getting total time and financial costs API: get_costs_total

Getting total time and financial costs API: get_costs_total


Sample get_costs_total request

?action=get_costs_total
Returns total time and cost data for projects or for a specific task

Optional parameters:
  • id_project — project ID (total costs of a particular project)
  • id_task — task ID (total costs of a particular  task)
  • datestart and dateend — searching data range in DD.MM.YYYY format (inclusive)
  • is_timer — time costs type, possible values:
    • 1 — received from the timer
      0 — entered manually
    • filter — filter for fetching data across multiple projects (see details below)
    • extra — additional info (can be specified with commas, for example extra=projects,tasks):
    • projects — total and monthly costs for each project in the selection (for a specific project or multiple projects when using id_project or filter, or for all projects when no project-selection parameters are provided). The parameter is ignored when id_task is used
      tasks or tasks_top_level — total costs for each task and subtask, or for tasks only, but including subtask costs. These paremeters are applied only when projects is specified

    Available values for filter (for get_costs_total method)

    Filter by ID
    project=2456
    Filter by ID range
    project in (1234, 1240)
    Combining filters
    *use parentheses ( ) and logical operators and, or (must be lowercase)
(project=2456 and project=2464) or project in (2450, 2470)

Sample JSON response
If the request succeeds, the response will contain ok status and the following data:

*without extra=projects
{
"status": "ok",
"total": {
"time": "30:00",
"money": "300.00", }
}
*with extra=projects
{
    "status": "ok",
    "projects": {
        "PROJECT_ID_1": {
            "time": "10:00",
            "money": "100.00",
            "monthly": {
                "2024-04": {
                    "time": "2:00",
                    "money": "20.00"
                },
                "2024-03": {
                    "time": "8:00",
                    "money": "80.00"
                },
                ... ... ...
            },
            "id": "PROJECT_ID_1",
            "name": "PROJECT_NAME_1",
            "page": "/project/PROJECT_ID_1/"
        },
        "PROJECT_ID_2": 
            ... ... ...
        ,
        ... ... ...
    },
    "total": {
        "time": "30:00",
        "money": "300.00"
    }
}
*with extra=projects,tasks
{
    "status": "ok",
    "projects": {
        "PROJECT_ID_1": {
            "time": "10:00",
"money": "100.00",
"monthly": { "2024-04": { "time": "2:00", "money": "20.00" }, ... ... ... }, "tasks": { "TASK_ID": { "id": "TASK_ID", "name": "TASK_NAME_1", "page": "/project/PROJECT_ID_1/TASK_ID/", "status": "done", "priority": "0..10", "time": "1:00", "money": "10.00", }, "SUBTASK_ID": ... ... ... , }, "id": "PROJECT_ID_1", "name": "PROJECT_NAME_1",
"page": "/project/PROJECT_ID_1/" }, "PROJECT_ID_2": ... ... ...
, ... ... ... }, "total": { "time": "30:00", "money": "300.00" } }