Introduction
The import feature is the only way to create and update user-locations. This guide explains how to achieve this, through four steps:1
Format Your CSV File
Make sure your file conforms to the expected CSV formatting.
2
Analyze Your CSV File
Check if there’s any error with your CSV file by uploading it with the
?create=false
query parameter.3
Import Your File
Once there’s no more errors, then your may upload it for processing with the
?create=true
query parameter.4
Track The Import Progress
Import may take a while depending on the number of rows, you can poll for its progress through the API.
You need to give your API key the
Import schedule
permission in Lucca Office.1. Format Your CSV File
UTF-8 encoded
The CSV file must be UTF-8 encoded (with BOM).
Semi-colon column divider
The expected divider between columns is a semi-colon character ”;”. Make sure to escape this character in cell values.
Header | Description | Required | Type |
---|---|---|---|
login | Login of the employee. | ✅ | string |
workLocationName | Name of the work location in Lucca Office (can be found in the work location admin page). | ✅ | string |
areaName | Name of the work location in Lucca Office (can be found in the work location admin page). | ❌ | string |
date | Date of the user location. | ✅ | Date<'YYYY-MM-DD' | 'YYYY/MM/DD'> |
position | The granularity of the user-location. | ✅ | Enum<'FullDay' | 'FirstHalf' | 'SecondHalf'> |
comment | Optional comment associated with the user location. | ❌ | string |
isDeletion | Whether the existing user-location for this day and employee should be deleted (true ) or not (false ). | ❌ | bool (default: false) |
Make sure to include the exact column headers in the first row of your CSV, as these are used for identification.
As a result, you’ll obtain one row per day or half-day of each employee.
- the
login
can be found by using the Users or Employee API endpoints. workLocationName
andareaName
can be found by using Work-locations API.
2. Upload Your File For Analysis
summaryId
, make sure to keep a note of it, you’ll need it.
For example, you can use it to track the progress of the analysis:
- Errors: these will block any proper import and thus must be fixed.
- Warnings: point out minor inconsistencies in the corresponding rows, but they can still be imported successfully.
3. Process Import
Please note that an import, once launched, cannot be undone.
?create=true
query parameter.
Feel free to set the overrideUserLocations
query parameter to true
if you want to replace existing User Locations.
summaryId
returned by the server.
- Errors indicate lines were not imported.
- Warnings point out minor inconsistencies in the corresponding rows, but still, they were imported successfully.