curl --request PUT \
--url https://{host}/timmi-timesheet/services/time-entries \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
[
{
"owner": {
"id": 123
},
"startsAt": "2024-05-06T00:00:00",
"duration": {
"iso": "PT4H"
},
"comment": null,
"timeSource": "manual",
"unit": "duration",
"timeType": null,
"axisSections": [
{
"id": 41
},
{
"id": 127
},
{
"id": 285
},
{
"id": 319
}
]
},
{
"owner": {
"id": 123
},
"startsAt": "2024-05-06T00:00:00",
"duration": {
"iso": "PT2H"
},
"comment": null,
"timeSource": "manual",
"unit": "duration",
"timeType": null,
"axisSections": [
{
"id": 41
},
{
"id": 290
},
{
"id": 309
},
{
"id": 311
}
]
},
{
"owner": {
"id": 123
},
"startsAt": "2024-05-07T00:00:00",
"duration": {
"iso": "PT7H20M"
},
"comment": "This is a comment",
"timeSource": "manual",
"unit": "duration",
"timeType": null,
"axisSections": [
{
"id": 41
},
{
"id": 127
},
{
"id": 285
},
{
"id": 319
}
]
}
]
'{
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"$[0]": [
"You cannot create a time entry that spans over two days."
],
"$[0].AxisSections": [
"AxisSections must all be active and consistent with the tree structure of their sections"
],
"$[2]": [
"You cannot create a time entry with a duration that exceeds 24h."
]
}
}This service is aimed at updating a given user TimeEntries easily, as it automatically detects and applies changes needed to transform whatever TimeEntries might currently exist to what you send it. It create, edit, or delete TimeEntries. An algorithm tries to match and update any existing TimeEntries, but it might wipe clean TimeEntries before adding new ones.
There are different ways to update TimeEntries. Please see this guide for a guide on how to update TimeEntries the right way depending on your use case.
It will create, edit, or delete existing TimeEntries for a given period and owner to match the TimeEntries of the request body.
The request body is an array of ‘simplified’ TimeEntries, please see the API reference for a TimeEntry model for additional information and main validation rules.
Here the TimeEntry id field is optional as the matching algorithm does not take it into account.
curl --request PUT \
--url https://{host}/timmi-timesheet/services/time-entries \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
[
{
"owner": {
"id": 123
},
"startsAt": "2024-05-06T00:00:00",
"duration": {
"iso": "PT4H"
},
"comment": null,
"timeSource": "manual",
"unit": "duration",
"timeType": null,
"axisSections": [
{
"id": 41
},
{
"id": 127
},
{
"id": 285
},
{
"id": 319
}
]
},
{
"owner": {
"id": 123
},
"startsAt": "2024-05-06T00:00:00",
"duration": {
"iso": "PT2H"
},
"comment": null,
"timeSource": "manual",
"unit": "duration",
"timeType": null,
"axisSections": [
{
"id": 41
},
{
"id": 290
},
{
"id": 309
},
{
"id": 311
}
]
},
{
"owner": {
"id": 123
},
"startsAt": "2024-05-07T00:00:00",
"duration": {
"iso": "PT7H20M"
},
"comment": "This is a comment",
"timeSource": "manual",
"unit": "duration",
"timeType": null,
"axisSections": [
{
"id": 41
},
{
"id": 127
},
{
"id": 285
},
{
"id": 319
}
]
}
]
'{
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"$[0]": [
"You cannot create a time entry that spans over two days."
],
"$[0].AxisSections": [
"AxisSections must all be active and consistent with the tree structure of their sections"
],
"$[2]": [
"You cannot create a time entry with a duration that exceeds 24h."
]
}
}API key. Value must be formatted like so: lucca application={api_key}.
First day (included) of the period you want to update with provided TimeEntries.
yyyy-MM-ddLast day (included) of the period you want to update with provided TimeEntries.
yyyy-MM-ddUnique identifier of the TimeEntries owner.
Show child attributes
The timeEntry start date and time. Please do NOT send any offset/timezone information ("Z", "+01:00", etc...).
"2023-10-12T12:00:00"
Unit in which the TimeEntry has been entered.
day, duration, time Show child attributes
The activities this TimeEntry should be associated with. When not in activity mode, send an empty array, or do not serialize this property.
Show child attributes
Optional reference of a configured Time Type. To use only if the timesheet is set up to use Time Types. Null otherwise.
Show child attributes
Attribute used to identify last modification source :
manual, import, timer A comment on the TimeEntry, visible on Lucca Timesheet user interface.
OK
Was this page helpful?