Skip to main content

Functional tree management (Data Structures)

Updated over 2 weeks ago

This section describes the API endpoints for listing, creating, modifying, and deleting functional trees (data structures).


Retrieve the list of available trees

Description

This request allows you to list the available trees to retrieve their identifiers (IDs), which are necessary for other requests.

Get v2/data-structures

Scope

To execute this request, you must have the metadata:read scope.

Parameters

  • Name (string, optional): allows you to specify the name of the tree for which you want to retrieve the identifier.

Note: If you omit this parameter, the request will return the list of all available trees in the environment.

This parameter must be added to the end of the URL to build the query string. It is preceded by a "?":

.../v2/data-structures?Name=[tree_name]

Example request

# Command to list data structures whose name contains "a" 
curl -X GET \
'https://xxx.indaba.api.indasuite.io-base.com/v2/data-structures?name=a' \

# ----- En-têtes -----
-H 'accept: application/json' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

{ 
"data": [
{
"id": "3ee3c063-5393-4e8e-ba6a-fbd46f6dfcc9",
"name": "Arbo_1"
},
{
"id": "106a1c95-00c2-4499-b8f9-fad7de91bf78",
"name": "Arbo_2"
}
],
"resultCode": 2010,
"message": "OK"
}

Common errors

Please refer to the list of common errors.


Create a tree

Description

This request allows you to create a new tree.

POST v2/data-structures

Scope

To execute this request, you must have the metadata:admin scope.

Parameters

  • Accept-Language (string, optional): Translates the default types of the tree into English or French. The parameter can take two values:

    • en: English

    • fr: French This parameter must be added in a header: -H 'Accept-Language: en'

Request Body

The following parameter must be provided in the request body:

  • name: name of the functional tree to create.

Example request

# Command to create a new tree named "Test"
curl -X 'POST' \
'https://xxx.indaba.api.indasuite.io-base.com/v2/data-structures' \

# ----- En-têtes -----
-H 'accept: application/json' \
-H 'Accept-Language: en' \
-H 'Authorization: Bearer VOTRE_JETON_JWT' \
-H 'Content-Type: application/json' \

# ----- Corps de la requête -----
-d '
{
"name": "Test"
}
'

Responses

Example of a valid response (200 OK) :

{ 
"data": {
"id": "3011c6de-3405-453d-bb56-3a700816b194",
"name": "Test"
},
"resultCode": 2010,
"message": "OK"
}

Common errors

Please refer to the list of common errors.


Update a tree

Description

This request allows you to change the name of an existing tree.

PUT v2/data-structures/{data_structure_id}

Scope

To execute this request, you must have the metadata:admin scope.

Parameters

This parameter must be added to the URL to build the request string:

/v2/data-structures/{data_structure_id}

Request Body

The following parameter must be provided in the request body:

  • name: new name for the tree.

Example request:

# Command to update the name of a tree
curl -X 'PUT' \
'https://xxx.indaba.api.indasuite.io-base.com/v2/data-structures/3011c6de-3405-453d-bb56-3a700816b194' \

# ----- En-têtes -----
-H 'accept: application/json' \
-H 'Authorization: Bearer VOTRE_JETON_JWT' \
-H 'Content-Type: application/json' \

# ----- Corps de la requête -----
-d '
{
"name": "Test_modif"
}
'

Responses

Example of a valid response (200 OK) :

Note : A new id is generated for the functional tree.

{ 
"data": {
"id": "3011c6de-3405-453d-bb56-3a700816b194",
"name": "Test_modif"
},
"resultCode": 2010,
"message": "OK"
}

Common errors

Please refer to the list of common errors.


Delete a tree

Description

This request allows you to delete an existing tree.

Delete v2/data-structures/{data_structure_id}

Scope

To execute this request, you must have the metadata:admin scope.

Parameters

This parameter must be added to the URL to build the request string:

/v2/data-structures/{data_structure_id}

Example request

# Command to delete a tree 
curl -X 'DELETE' \
'https://xxx.indaba.api.indasuite.io-base.com/v2/data-structures/b6798624-01f4-4ae0-95dc-983e52211e8b' \

# ----- En-têtes -----
-H 'accept: application/json' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

{ 
"resultCode": 2010,
"message": "OK"
}

Common errors

Please refer to the list of common errors.


Common Errors

You will primarily encounter the following HTTP error codes:

  • 400 Bad Request: Your request is malformed. This may be due to a missing parameter, an incorrect data type, or invalid JSON. The response body will contain an errors array detailing the problem.

{ 
"errors": [
{
"error": "Type_De_L_Erreur",
"message": "Description détaillée de l'erreur spécifique."
}
],
"statusCode": 1050,
"message": "Invalid request"
}
  • 401 Unauthorized: Your authentication token (JWT) is missing, invalid, or expired. You must obtain a new valid token.

  • 403 Forbidden: Your authentication token is valid, but you do not have the necessary rights for this action. This can happen for two reasons:

    • Your token does not have the required scope (e.g., you are trying to write data without the metrics:write scope).

    • Your token has the correct scope, but your user (or service account) is not linked to an authorization that grants access to the requested metric.

  • 404 Not Found: The resource you are trying to reach does not exist. This typically occurs if you are using an incorrect ID or requesting a metric that does not exist.

Did this answer your question?