Use this method to export segments to a TMX file (as a ZIP archive). You can export projects, jobs, resources and even multiple resources and apply a wide range of filters.
Note that the TMX is of version 1.4.
URL
...
Wordbee proposes many different reports and you can even build your own report templates with the Business Report module.
The present method returns a list of all available reports (or report templates) including a unique ID. This ID is then passed to the method that creates the report.
URL
(GET) /api/resources/segments/io/tmxreports/items/{scope}
PARAMETERS
The message body contains a JSON object.
Generic export propertiesURL parameters are:
...
scope | Specify the scope |
...
The scope object tells the system what data to export. Examples:
Export a project memory, translation memory or term base by specifying its resource ID:
Code Block |
---|
{ "type": "DocumentSet", "dsid": 157 } |
Export a project memory by specifying its project ID:
Code Block |
---|
{ "type": "Project", "projectid": 7726 } |
See all available scopes here.
...
Mandatory
object
...
The list of all locales that you want to export.
Code Block |
---|
"locales": [ "de-DE", "de-AT", "fr-FR" ] |
...
An optional filter to apply to the exported data. Sample use cases are:
- Exclude any translations in red status
- Export translations with certain custom fields only
- etc.
The query properties and features are described here. Example of exporting texts in neutral (0) or green (1) status thus excluding red status (2):
...
of segments, such as Project, Job, DocumentSet, Resource etc. for which you intend to print the report. Some reports are available only for certain scopes. This page: scope object explains all available options. If omitted, this method returns only those reports that are available with all scopes. | string, Optional |
RESULTS
The method returns all available reports with ID, title and description:
Code Block | ||
---|---|---|
[ { "id": "_revisions", "title": "Revisions", "description": "Print segments with human revisions" }, {{ " locid":[ " en_postedits", "de title", : "fr Post-edits"] , "status description":{ 0, 1 } } "Print segments with human editing of machine or pretranslations"] } IMPORTANT: The query has 2 functions: On the one hand it filters the segments and on the other hand it removes any translations that do not match the filter. In the example above, the query first identifies segments where at least one of the 3 languages is not in red status. In a second step, the system removes any languages that are in red status. | Optional, object | |
src | The source locale. It is highly recommended to set this value if you know it. Otherwise, the system chooses the first entry in locales. | Optional, string | minimumTexts | Optional, int | skipTargetIsSource | Optional, bool |
excludeCommentTypes | Optional. List of numeric comments categories. If set then only comments of these categories are included in the export. Categories are sequentially numbered and start at 0. | Optional, int[] |
markupRemove | Optional, default is false. If true then markup is removed from texts. See also property below. | Optional, bool |
markupReplaceChar | Optional, default is null. When you set markupRemove to true then any markup will be replaced by this character. Note: You must specify a single character such as: "markupReplaceChar": " " | Optional, char | localesMappings |
Code Block | Optional, object |
TMX specific options
...
Optional, default is false.
If true then the system includes Wordbee specific properties in the TMX file. These properties are saved as standard prop nodes.
...
" |
...
Segment level properties in "tu" node:
...
id |
...
" |
...
Text level properties in "tuv" node:
- x-wb-status
- x-wb-bookmark
- x-wb-locked
- x-wb-validation
- x-wb-editor
- x-wb-prefix
- x-wb-suffix
- x-wb-ctx
...
Optional, default is false.
If true then any TMX attributes saved with the segment are extracted. These either were previously imported from a TMX or manually added in the translatio editor.
...
Optional, default is false.
If true then any TMX attributes saved with a segment's text are extracted. These either were previously imported from a TMX or manually added in the translatio editor.
...
Optional, default is true.
If true then the last editing user's initials are extracted to TMX:
- "tuv" node, attribute "changeid"
...
Optional, default is false.
If true then further meta data attributes "x-wb..." are added to the export. When later reimporting this TMX, the system is able to restore all properties.
- x-wb-tag
...
RESULTS
This API method is an "asynchronous" operation. It either immediately returns the result or instead an operation ID which you need to periodically poll until the operation has finished.
Upon the first call you typically get an "operationid". Use this to further poll the operation status. See full explanation here: Asynchronous operation
When the operation is finished you get the reference to the file:
Code Block |
---|
{: "_all", "trmtitle": {"All", "statusdescription": "FinishedPrint all segments" ... }, "custom": { "filerefid": "52e77705f6904233b0c33b2e5d7c4a80S710", "filenametitle": "export.zipDocument translations, revisions and comments", "segmentsdescription": 10 } } |
Once the operation is finished, download the file with fileref and this API method:
Code Block |
---|
(GET) /api/media/get/{fileref} |
EXAMPLES
...
"This report prints source texts and translations for a document or project with revisions history and comments. It contains information for a single target language."
}
] |
EXAMPLES
Get all reports to print translations of a job:
Code Block |
---|
(POSTGET) /api/resources/segments/reports/io/tmx BODY: { "scope": { "type": "DocumentSet", "dsid": 112334 }, "locales": [ "en", "fr" ] }items/Job |