Skip to main content

projects/{did}/documents/offline/import/init (GET)

Prepare for the subsequent import of translated Word, Excel or XLIFF files to a project. This method does a couple of things:

  • It creates a new files collection with its unique key. You will use this key to upload your file/s, see media/filescollection/{key}/items/file (POST) .

  • It displays the file types/extensions allowed for upload and import.

  • It shows the maximum number of files you can upload, as well as the maximum size limit for each file.

URL

CODE
(GET) /api/projects/{pid}/documents/offline/import/init

PARAMETERS

The URL parameters are:

pid

The project ID

int, Mandatory

RESULTS

The result is a JSON object. The properties you need in the context of an import are just these:

canXliff

Indicates if importing XLIFF files is authorized.

bool

canOffice

Indicates if importing Microsoft Word or Excel files is authorized.

bool

files.key

The unique files collection identifier.

string

files.maxFileSizeMB

The maximum size limit for each file in MiB. The default is 50.

integer

files.maxFiles

The maximum number of files you can import in one step. The default is 50.

integer

files

This object represents a new empty files collection and its contents (the files array). With the files.key you can now start uploading files.

For a detailed description see the result documented in:media/filescollection/{key}/items

object

EXAMPLES

We initiate an import to a project with ID 1000. Use projects/list to find project IDs by project reference or other criteria.

CODE
GET /api/projects/1000/documents/offline/import/init

The method returns various properties:

CODE
{
    "canXliff": true,
    "canOffice": true,
    "options": {
        "commit": false,
        "writeLocked": false
    },
    "files": {
        "key": "5457027a-5c62-479a-aee1-f7dbbe3bfc28",
        "mandatory": true,
        "allowAnyFile": false,
        "maxFileSizeMB": 50,
        "maxFiles": 50,
        "parserProfileId": null,
        "parserDomains": null,
        "extensions": [
            ".xlf",
            ".xlif",
            ".xliff",
            ".xlsx",
            ".docx"
        ],
        "pageCountEnabled": false,
        "pageCountExtensions": null,
        "files": []
    }
}

Use files.key to then upload your file or your files to the “files collection”. Once the uploads are done you proceed with the actual import method.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.