Home/Technical requirements/API/API - Import organizational structure
API – Import organizational structure
Before making a request - log in as a user with the role of Administrator. How to log in via API is described here API – Authorization
- To import an organizational structure, you need to send POST request to the following URI /api/v2/orgstructure/import
- The request must be accompanied by a file in the CSV format like this:
department code; name of the department; parent department code
Important: The code of the parent unit must contain an empty value! Not 0 or NULL.
- The request must contain the headings Content-Type: multipart/form-data and Authorization: Bearer xxxxxx.
curl 'https://your-domain.davintoo.com/api/v2/orgstructure/import' -H 'Authorization: Bearer xxxxxx' -H 'Content-Type: multipart/form-data' -F '[email protected]/path/to/structure.csv'
Instead of a local address https://your-domain.davintoo.com you need to use the address of your instance.