DeleteTu

From Wordfast Wiki
Revision as of 15:51, 20 March 2015 by Remiandre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Return to command list

DeleteTu

deleteTu (string key, int cmd, int tmId, string tuId)

Delete a Translation Unit from the given Translation Memory.

Parameters

key string a valid API Key, generated by making a share at www.freetm.com
cmd int command number is 9
tmId int Translation Memory ID
tuId string TU ID coming from the last recent search. CAUTION, a search must done before deleting to get a valid tuId.

Returned value

success boolean result of the command (true or false)
error string error message

Request example

json post with javascript

var data = {};
data["key"] = "example@key";
data["cmd"] = 9;
data["tmId"] = 1;
data["tuId"] = "88474b70-5f70-11e4-aad0-5c539f6f39a2";
var xhr = new XMLHttpRequest();
xhr.open("POST", "www.freetm.com/wfa/api", true);
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.send(JSON.stringify(data));

post

<form action="www.freetm./wfa/api" method="post">
 Key: <input type="text" id="key" name="key" value="example@key"/>
 Command: <input type="text" id="cmd" name="cmd" value="9"/>
 TM Id: <input type="text" id="tmId" name="tmId"/>
 TU Id: <input type="text" id="tuId" name="tuId"/>
 <input type="submit" value="Submit">
</form>

get

www.freetm.com/wfa/api?key=example@key&cmd=9&tmId=1&tuId=88474b70-5f70-11e4-aad0-5c539f6f39a2

Response example

json

{
  "success": true
  ,"error":  ""     
}

without white space (new line, carriage return or tabulation).

text

true 
true or an error message 

Remarks