Kimai2: API doenst let me specify a duration at Timesheet creation

Created on 5 Jan 2021  路  3Comments  路  Source: kevinpapst/kimai2

Describe the bug
I try to create a timesheet through post request. The documentations say i can put a "duration" field in JSON Body but everything i get back is.

{
    "code": 400,
    "message": "Validation Failed",
    "errors": {
        "errors": [
            "This form should not contain extra fields."
        ],
        "children": {
            "project": {},
            "activity": {},
            "description": {},
            "tags": {},
            "user": {},
            "exported": {}
        }
    }
}

To Reproduce

  1. Send POST Request to /api/timesheets
  2. Set body to: { "duration": 1800, "project": 30, "activity": 2, "description": "Test" }

Additional context

  • Kimai version: 1.12 stable (Ayumi)
  • Device: Macbook Pro 16"
  • Browser Postman
API bug documentation

Most helpful comment

Yes, but still a bug here ^^ so I'll reopen to keep track of it.

All 3 comments

Thats a bug in the API documentation. Please use begin and end field.

I found out that it's related to the time-tracking mode.
I changed it to default, now the begin and end field works.

Thanks for your reply

Yes, but still a bug here ^^ so I'll reopen to keep track of it.

Was this page helpful?
0 / 5 - 0 ratings