Documentation Index
Fetch the complete documentation index at: https://developers.lucca.fr/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
This guide is aimed at helping you generate Timesheet reports directly through API requests.Prerequisites
You will need:- (required) Your domain name
{yourDomain}, eg: “https://myawesomecompany.ilucca.net”. - (required) An API key
{apiKey}that has report generation rights.
Guide
Areport can only be generated from an existing report-template, referenced by its unique identifier templateId, for which your API key must have access to.
If an existing report-template is publicly available, you can generate a report from it.
But in most cases, you will need to create a dedicated report-template for your API key.
1. Create a report-template
As the resource is not yet documented, the easiest way is to create a newreport-template through Lucca Timesheet user interface, then copy-paste the generated payload to make your POST request /report-templates with your API key.
For example :
report-template {id} will be answered in reponse.
2. Generate a new report from this report-template
You can now generate a report through/timmi-timesheet/api/reports with :
- The
report-template{id}you just created. - The start date of the report to generate
{reportStartDate}. If left null, default date from thereport-templateis applied. - The end date of the report to generate
{reportEndDate}. If left null, default date from thereport-templateis applied.
- the identifier
(integer) idof the created report, to be kept carefully as the{reportId} - the status
(string) statusof the generation of its content, which is an enum:
Background process
The generation of a report content is a background process. As long as this process is not complete, the report status stayspending. Once the report is complete, its status is set to done. May an error be encountered while generating its content, then its status is set to error.
The report content can only be viewed and downloaded once it is done.
The generation of the report is an asynchronous process. In practice, when the POST request is received, the server immediately responds with a 200 OK if successful, otherwise an error code is displayed.
3. Track report background building progress
The next request should be repeated at regular intervals (say, every 10 seconds) until the response indicates adone status (rather than pending).
If request is met with an error, the status error will be returned. In this case, it will be necessary to try creating a new report and if the error occurs again, please contact our support.
Here, {reportId} should be equal to the identifier of report recovered in response to the previous POST:
4. Download the finalized report data
Once the content of the report is generated (statusdone), it can be downloaded in a CSV file: