LMS Collaborator knowledge base

Home/Technical requirements/API/API - Import organizational structure

API – Import organizational structure

  • To import an organizational structure, you need to send POST request to the following URI /api/v2/orgstructure/import

You can import the organizational structure in two ways:

  1. using a CSV file;
  2. in JSON format.

Import with CSV file

  • The request must be accompanied by a file in the CSV format like this:
  • The request must contain the headings Content-Type: multipart/form-data та X-Cbr-Authorization: Bearer API_TOKEN.

Request example:

curl 'https://your-domain.davintoo.com/api/v2/orgstructure/import' -H 'X-Cbr-Authorization: Bearer API_TOKEN' -H 'Content-Type: multipart/form-data' -F 'file=@/path/to/structure.csv'

Import of organizational structure in JSON format

Instead of a CSV file, you can add information about the organizational structure in JSON format to the body of the request, for example:

  • The request must contain the headers Content-Type: application/json and X-Cbr-Authorization: Bearer API_TOKEN
  • Body settings: raw, JSON

Request example:

`curl 'https://your-domain.davintoo.com/api/v2/orgstructure/import' -H 'X-Cbr-Authorization: Bearer API_TOKEN' -H 'Content-Type: application/json'

Importing multiple organizational structures

Importing multiple organizational structures is available only if the Allow import multiple organizational structures option is enabled in the orgstructure policies.
You must also select either the By import value or Hybrid orgstructure import mode. If the By attributes settings mode is selected, the request will be rejected and the system will return the following error: Invalid orgstructure mode, setup 'import' or 'hybrid'.

To perform the import, you must provide a prefix used to distinguish between multiple org structures. This can be done in one of two ways:

  • in the query parameter
    'https://your-domain.davintoo.com/api/v2/orgstructure/import?prefix=part1'

  • in the HTTP header
    'X-Cbr-Orgstructure-Prefix: part1'

Still have questions?
Our technical support team is always happy to help!
Write to us at technical support [email protected]. If you are registered on our Helpdesk - send request button below.
Send request