Before starting
This sheet explains how to retrieve the list of analytical sections of a Lucca instance. It is for advanced administrators.
The data are retrieved in three steps
- Constructing the API request
- Generating the query
- Using the response
Building the API request and retrieving 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 create this request, you can refer to the relevant documentation.
Request base
The request systematically starts with your base URL, so the name of your instance is required, for example {NameInstance}, followed by /api/v3/axisSections which indicates you want to recover the analytical axis sections.
This gives https://{NameInstance}.ilucca.net/api/v3/axisSections
Choice of fields for display
Then select the fields you want to display and add them after ...axisSections?fields=,separating them with a comma.
For example, if you want to display the ID, the name, the code and whether or not it is active, this gives: https://{NameInstance}.ilucca.net/api/v3/axisSections?fields=id,name,code,active
Which fields are recoverable?
This depends on your needs, but here are the most commonly used fields:
Field name | Description |
ID | Corresponds to the section's unique ID. Is necessary if you want to edit the code of a section via an import. |
Name | Section name |
Code | Section code. Required when importing |
Section ID | ID 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 |
You can also view this image:
(Optional) Filtering by the section
You can then filter by the desired section, for example.
To do this, you need the section ID. If you decide to display the analytical section sections "Test" here, use ID 8:
You need to add it to the URL after ...?fields=...&axisId=
For this analytical section with ID 8, this gives https://{NomInstance}.ilucca.net/api/v3/axisSections?fields=id,name,code,active&axisId=8
Generate the query
Once the request is complete, the easiest thing to do is to go to your browser and go to the URL created.
Use a browser you have recently used to connect to Lucca.
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.
The part of the response for copying is highlighted in this image:
For example, for the site https://www.convertcsv.com/json-to-csv.htm just copy here:
In the Result section, you will have the Excel or CSV version.
You can also use this file to re-import it if you need to make changes. In this case, enter the ID in the fields and preferably put it in the first column, or use the section code, then put in the file in CSV format with a separating comma. In the example for this site, it is in the "options" tab.