Before you get started
This sheet explains how to retrieve the list of analytical sections of a Lucca instance. It is for advanced administrators.
The data are recovered in three steps
- Constructing the API request
- Generating the query
- Using the response
Building the API request to retrieve the data
The current interface for managing analytical sections does not allow you to retrieve the list of analytical sections. To do this, you must make an API request.
To build this query, you can use the relevant documentation.
A simpler alternative is to construct the URL directly from the interface of your Lucca instance, which is accessible at the URL with the following format:https://mycompany.ilucca.net/apihelp
Once on the interface, click "axissections" in the left hand column.
This interface allows you to build the query by adding the fields you want, by simply checking them in the list.
Which fields should you retrieve?
This depends on your needs, but here are the most commonly used fields:
Field name | Description |
ID | Corresponds to the section's unique identifier. Is necessary if you want to edit the code of a section via an import. |
Name | Section name |
Log code | Section code. Required when importing |
AxisId | Identifier of the section to which the section belongs. Required when importing |
Active | Indicates whether the section is archived (active = false) or not |
Owner | Manager of the analytical section |
ParentAxisSections | Sections of the parent section to which the section is attached |
Departments | If restricted access: departments with access to the section |
LegalEntities | If restricted access: establishments with access to the section |
Users | If restricted access: users with access to the section |
Generate the query
Once you have checked the required fields, you have two options to generate the query:
- From the interface, by clicking on GET in the right part.
- If the request is taking too long, you can also retrieve the query /api/v3.... from the interface, and paste it directly into your browser's URL.
This will give you a URL with this format:https://morgan.ilucca-demo.net/api/v3/axissections?fields=id,name,axisid,code,active
The result of the query will then be displayed in your browser:
Using the result of the query
The response to this query will be in the JSON format. You can easily use a tool that will convert this format to Excel (e.g. http://www.convertcsv.com/json-to-csv.htm).
Generally, copying the response in JSON format into the selected tool to obtain a file in Excel format is enough.
You can also use this file to re-import it if you need to make changes. In this case, the section ID in the first column is preferable, or failing that, the section code.