This page explains how to retrieve the list of analytical sections from a Lucca instance. It is intended for advanced administrators.
There are three steps for retrieving data:
- Constructing the API request
- Generating the request
- Exploiting the API response
Constructing the API request for retrieving data
The current management interface for analytical axes does not allow you to retrieve the list of analytical sections. To do this, you must send an API request.
To construct this request, you can use the documents concerned.
A simpler alternative is creating an URL directly from your Lucca instance’s interface, which can be accessed at the URL in the following format: https://mycompany.ilucca.net/apihelp.
When you are in the interface, click on ‘axissections’ in the left-hand column.
This interface allows you to create the request by adding the fields you want: simply tick them in the list.
What fields do you want to retrieve?
This depends on your needs, but these are the most commonly used fields:
|ID||The unique identifier for the section. Necessary if you want to change the code for a section via an import.|
|Name||Name of the section|
|Code||Code for the section. Required for imports|
|AxisId||Identifier for the axis the section belongs to. Required for imports|
|Active||Indicates if the section is archived (active = false) or not|
|Owner||Party responsible for the analytical section|
|ParentAxisSections||Sections of the parent to which the section is linked|
|Departments||If access restriction: departments with access to the section|
|LegalEntities||If access restriction: legal entities with access to the section|
|Users||If access restriction: users with access to the section|
Generating the request
After you have ticked the fields you want, there are two ways of generating the request:
- From the interface, click on GET on the right-hand side.
- If the request takes too long, you can also retrieve the request /api/v3... from the interface and paste it directly onto the URL in your browser.
This will give you an URL in the following format: https://morgan.ilucca-demo.net/api/v3/axissections?fields=id,name,axisid,code,active
The result of the request will then appear in your browser:
Exploiting the result of the request
The response to this request will be in JSON format. You can easily use a tool to convert this format to Excel format (e.g. http://www.convertcsv.com/json-to-csv.htm).
Generally, you can simply copy the JSON response into the tool selected to get a file in Excel format.
You can also exploit this file to reimport it if you need to make changes. In this case, take the section’s ID from the first column or, in its absence, the section’s code.