Authentication
You can use the API to export and import both the newest and the first versions of codebooks. A standard token-based authentication is to be used to access this API.
For export, you will need the database identifier hash.
Codebook V.2
You can export a codebook from an existing database by calling the following endpoints:
GET /api/v2/projects/{db_hash}/api/codebook/export-v2/
To import a codebook, get ready with an Excel file and use
POST /api/v2/projects/{projectId}/api/codebook/import-v2/
For Codbook v.2, export in JSON format is also available:
GET /api/v2/projects/{db_hash}/api/codebook/export-v2/json
Import from JSON is not possible at the time.
Codebook V.1
You can download codebooks from an existing database by calling the following endpoints:
GET /api/v2/projects/{db_hash}/api/codebook/export
This one will download an optimized version of the codebook. DataTile will try to detect naming patterns in the database schema and generate an optimized codebook with ARR notation.
GET /api/v2/projects/{db_hash}/api/codebook/export-lab
POST an Excel file as mime/multipart to the following endpoint
POST /api/v2/projects/{projectId}/api/codebook/import