这似乎工作正常:
curl -H 'content-type':'application/json' -H 'X-Api-Key':'<my-key>' -X POST --data '{"start": "2018-06-12T13:48:14.000Z", "tagIds": ["<my-tag-id>"] }' https://api.clockify.me/api/workspaces/<my-workspace-id>/timeEntries/
它以给定的时间戳开始创建一个没有结束日期(时钟仍在运行)的新条目。“开始”似乎是必填字段。如果我省略“开始”字段,我会收到错误消息:
{"message":"text","code":3002}%
我想知道现在是否可以在没有绝对时间戳的情况下启动时钟,即通过执行以下操作:
curl -H 'content-type':'application/json' -H 'X-Api-Key':'<my-key>' -X POST --data '{"start": "now", "tagIds": ["<my-tag-id>"] }' https://api.clockify.me/api/workspaces/<my-workspace-id>/timeEntries/
不幸的是,“现在”不起作用:
{"message":"Could not read document: Can not construct instance of com.clockify.adapter.http.timeentry.CreateTimeEntryRequest, problem: Text '' could not be parsed at index 0\n at [Source: java.io.PushbackInputStream@1817b774; line: 1, column: 54]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.clockify.adapter.http.timeentry.CreateTimeEntryRequest, problem: Text '' could not be parsed at index 0\n at [Source: java.io.PushbackInputStream@1817b774; line: 1, column: 54]","code":3002}%