|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd"> |
| 3 | +<topic id="getTu"> |
| 4 | + <title>Get Translation Unit</title> |
| 5 | + <body> |
| 6 | + <p>End point: <tt>[RemoteTM URL]/memories</tt><tt> </tt></p> |
| 7 | + <p>Send a <tt>POST</tt> request with these headers:</p> |
| 8 | + <simpletable> |
| 9 | + <sthead> |
| 10 | + <stentry>Header</stentry> |
| 11 | + <stentry>Value</stentry> |
| 12 | + </sthead> |
| 13 | + <strow> |
| 14 | + <stentry><tt>Session</tt> </stentry> |
| 15 | + <stentry>The ticket received from <xref href="authorizationRequest.dita">Authorization Request</xref></stentry> |
| 16 | + </strow> |
| 17 | + <strow> |
| 18 | + <stentry><tt>Content-Type</tt></stentry> |
| 19 | + <stentry><tt>application/json</tt></stentry> |
| 20 | + </strow> |
| 21 | + </simpletable> |
| 22 | + <p>Include these parameters in a JSON body:</p> |
| 23 | + <simpletable> |
| 24 | + <sthead> |
| 25 | + <stentry>Parameter</stentry> |
| 26 | + <stentry>Value</stentry> |
| 27 | + </sthead> |
| 28 | + <strow> |
| 29 | + <stentry><tt>command</tt></stentry> |
| 30 | + <stentry><tt>getTu</tt></stentry> |
| 31 | + </strow> |
| 32 | + <strow> |
| 33 | + <stentry><tt>memory</tt> </stentry> |
| 34 | + <stentry>ID of the memory to query</stentry> |
| 35 | + </strow> |
| 36 | + <strow> |
| 37 | + <stentry><tt>tuid</tt> </stentry> |
| 38 | + <stentry>ID of the translation unit to retrieve</stentry> |
| 39 | + </strow> |
| 40 | + </simpletable> |
| 41 | + <p>Example:</p> |
| 42 | + <codeblock>{ |
| 43 | + "command": "getTu", |
| 44 | + "memory": "1617963861912", |
| 45 | + "tuid": "1668707130-10-12-12" |
| 46 | +}</codeblock> |
| 47 | + <p>RemoteTM responds with a JSON object.</p> |
| 48 | + <p>On success, field 'status' is set to 'OK' and requested translation unit is included in |
| 49 | + 'tu' field, escaped for JSON format. Example:</p> |
| 50 | + <codeblock translate="no">{ |
| 51 | + "tu": "<tu tuid=\"1668707130-10-12-12\"> ... </tu>", |
| 52 | + "status": "OK" |
| 53 | +}</codeblock> |
| 54 | + <p>On error, field 'status' is set to 'Error' and field 'reason' contains the error cause. |
| 55 | + Example:</p> |
| 56 | + <codeblock translate="no">{ |
| 57 | + "status": "Error", |
| 58 | + "reason": "TU does not exist" |
| 59 | +}</codeblock> |
| 60 | + </body> |
| 61 | +</topic> |
0 commit comments