resources/segments/view/export
To export segments to a Word, Excel or Xliff file for offline editing.
URL
(POST) /resources/segments/view/export
PARAMETERS
The message body contains a JSON object:
scope | The scope object. It delimits the total range of segments and related resources that can be operated on. | Mandatory |
type | Export format:
| Mandatory |
layout | Spreadsheet Layout (Object) with a list of the information types to be rendered as columns (different languages, comments, status, and so on). If null or not specified, the spreadsheet is preset for 2 columns: Source text and translation (first if there are multiple). Example for source/target language columns: "layout" : { "columns": [ { "fkey": "1~en~0" }, { "fkey": "1~fr~0" } ] } | Optional |
query | Specifies the segments to export. See query object in resources/segments/search Do not use the alternative query format Query (Object) - it is deprecated and will be removed | Mandatory |
filename | The name of file generated (Default value : "Export") | Optional |
tmhits | Used only if the layout defines a column containing the most relevant translation memory hits. Specifies how top hits are selected and further permits to apply filters on various properties such as status, bookmarks, context, change date and so on. "tmhits": { "filter": [ { "field": "st", "values": [ 1 ] }, { "field": "bk", "values": [ 1, 2 ] } ], "ctxboost": null } Read details here: | Optional, object? |
RESULTS
The system return an Asynchronous operation:
{ "trm": { "requestid":XXXXX, "isbatch":false, "status":"Waiting", "statusText":"Waiting..." } }
When the asynchronous operation is ended, you receive the next message:
{ "trm": { "requestid": 0, "isbatch": false, "status": "Finished", "statusText": "Finished!" }, "result": { "items": [{ "k": "res", "v": { "fileref": "2a27db94a02d42c68b74b9276ffd4cbc", "filename": "export_en.xlf", "segments": 9 } } ] }, "custom": { "fileref": "2a27db94a02d42c68b74b9276ffd4cbc", "filename": "export_en.xlf", "segments": 9 } }
Get the file: You need to use the call media/get/{token} with token is the "fileref" property in the previous result.
Copyright Wordbee - Buzzin' Outside the Box since 2008