API – Import organizational structure
Use the API token for authorization. Read more in the article API token
- 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
a3123910441;department 1;
a2567104662;department 1.2;a3123910441
a2701216083;department 1.2.1;a2567104662
a2206647782;department 1.2.2;a2567104662
a3123410541;department 2;
a1468104662;department 2.1;a3123410541
a1206747582;department 2.1.2;a1468104662
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.
Request example:
curl 'https://your-domain.davintoo.com/api/v2/orgstructure/import' -H 'Authorization: Bearer xxxxxx' -H 'Content-Type: multipart/form-data' -F 'file=@/path/to/structure.csv'
Instead of a local address https://your-domain.davintoo.com you need to use the address of your instance.