Represents various types of translatable files to be processed by the server instead of the REST client. This REST interface provides endpoints for uploading and downloading files in multiple formats.
Deprecated. A list of document types supported by the server. The result will not be deserializable if the server supports document types which the client does not know about (eg compiled against a newer version of zanata-api), also any changes to the list of supported file extensions for existing types will not be visible to the client.
media type | data type | description |
---|---|---|
application/json | array of object (JSON) | a List of DocumentType |
GET /file/accepted_document_types Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
...
Deprecated. Returns the source file extensions supported by the server.
media type | data type | description |
---|---|---|
text/plain | (custom) | a semicolon-separated list of file extensions |
GET /file/accepted_types Accept: text/plain
HTTP/1.1 200 OK
Content-Type: text/plain
...
A list of document types supported by the server, along with their default file extensions.
media type | data type | description |
---|---|---|
application/json | array of object (JSON) | a List of FileTypeInfo |
GET /file/file_type_info Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
...
Downloads a previously generated file.
name | type | description |
---|---|---|
downloadId | path | The Zanata generated download id. |
media type | data type | description |
---|---|---|
application/octet-stream | (custom) | The following response status codes will be returned from this
operation: OK(200) - A translation file in the requested format with translations for the requested document in a project, iteration and locale. NOT FOUND(404) - If a downloadable file is not found for the given id, or is not yet ready for download (i.e. the system is still preparing it). INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation. |
GET /file/download/{downloadId} Accept: application/octet-stream
HTTP/1.1 200 OK
Content-Type: application/octet-stream
...
Upload a source file (or file chunk) to Zanata. Allows breaking up files into smaller chunks for very large files. In this case, the first invocation of this service will return an 'upload id' which needs to be used in subsequent calls to tie all the uploaded chunks together. The file will only be processed when all chunks have been fully uploaded. With each uploaded chunk, the multipart message's 'last' parameter will indicate if it is the last expected chunk.
name | type | description |
---|---|---|
iterationSlug | path | The project version slug where to store the document. |
projectSlug | path | The project slug where to store the document. |
docId | query | The full Document identifier |
media type | data type | description |
---|---|---|
multipart/form-data | (custom) | The multi-part form body for the file or chunk. |
media type | data type | description |
---|---|---|
application/xml | chunkUploadResponseType (XML) | A message with information about the upload operation. |
POST /file/source/{projectSlug}/{iterationSlug}
Content-Type: multipart/form-data
Accept: application/xml
...
HTTP/1.1 201 Created
Content-Type: application/xml
<chunkUploadResponse xmlns="http://zanata.org/namespace/api/">
<uploadId>...</uploadId>
<acceptedChunks>...</acceptedChunks>
<expectingMore>...</expectingMore>
<successMessage>...</successMessage>
<errorMessage>...</errorMessage>
</chunkUploadResponse>
Downloads a single source file.
name | type | description |
---|---|---|
fileType | path | use 'raw' for original source if available, or 'pot' to generate pot from source strings |
iterationSlug | path | |
projectSlug | path | |
docId | query |
media type | data type | description |
---|---|---|
application/octet-stream | (custom) | response with status code 404 if the document is not found, 415 if fileType is not valid for the document, otherwise 200 with attached document. |
GET /file/source/{projectSlug}/{iterationSlug}/{fileType} Accept: application/octet-stream
HTTP/1.1 200 OK
Content-Type: application/octet-stream
...
Upload a translation file (or file chunk) to Zanata. Allows breaking up files into smaller chunks for very large files. In this case, the first invocation of this service will return an 'upload id' which needs to be used in subsequent calls to tie all the uploaded chunks together. The file will only be processed when all chunks have been fully uploaded. With each uploaded chunk, the multipart message's 'last' parameter will indicate if it is the last expected chunk.
name | type | description |
---|---|---|
iterationSlug | path | The project version slug where to store the document. |
locale | path | The locale (language) for the translation file. |
projectSlug | path | The project slug where to store the document. |
docId | query | The full Document identifier. |
merge | query | Indicates whether to merge translations or overwrite all translations with the contents of the uploaded file. |
media type | data type | description |
---|---|---|
multipart/form-data | (custom) | The multi-part form body for the file or chunk. |
media type | data type | description |
---|---|---|
application/xml | chunkUploadResponseType (XML) | A message with information about the upload operation. |
POST /file/translation/{projectSlug}/{iterationSlug}/{locale}
Content-Type: multipart/form-data
Accept: application/xml
...
HTTP/1.1 201 Created
Content-Type: application/xml
<chunkUploadResponse xmlns="http://zanata.org/namespace/api/">
<uploadId>...</uploadId>
<acceptedChunks>...</acceptedChunks>
<expectingMore>...</expectingMore>
<successMessage>...</successMessage>
<errorMessage>...</errorMessage>
</chunkUploadResponse>
Downloads a single translation file. To download a preview-document or translated document where a raw source document is available, use fileType 'half_baked' and 'baked' respectively.
name | type | description |
---|---|---|
fileType | path | File type to be downloaded. (Options: 'po', 'half_baked', 'baked') |
iterationSlug | path | Project iteration identifier. |
locale | path | Translations for this locale will be contained in the downloaded document. |
projectSlug | path | Project identifier. |
docId | query | Document identifier to fetch translations for. |
media type | data type | description |
---|---|---|
application/octet-stream | (custom) | The following response status codes will be returned from this
operation: OK(200) - A translation file in the requested format with translations for the requested document in a project, iteration and locale. NOT FOUND(404) - If a document is not found with the given parameters. INTERNAL SERVER ERROR(500) - If there is an unexpected error in the server while performing this operation. |
GET /file/translation/{projectSlug}/{iterationSlug}/{locale}/{fileType} Accept: application/octet-stream
HTTP/1.1 200 OK
Content-Type: application/octet-stream
...