Difference between revisions of "DeleteTu"

From Wordfast Wiki
Jump to: navigation, search
 
(DeleteTu)
 
Line 44: Line 44:
 
  data["tuId"] = "88474b70-5f70-11e4-aad0-5c539f6f39a2";
 
  data["tuId"] = "88474b70-5f70-11e4-aad0-5c539f6f39a2";
 
  var xhr = new XMLHttpRequest();
 
  var xhr = new XMLHttpRequest();
  xhr.open("POST", "www.freetm.com/wfa/api", true);
+
  xhr.open("POST", "anywhere.wordfast.com/wfa/api", true);
 
  xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
 
  xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
 
  xhr.send(JSON.stringify(data));
 
  xhr.send(JSON.stringify(data));
 
   
 
   
 
==== post ====
 
==== post ====
  <form action="www.freetm./wfa/api" method="post">
+
  <form action="anywhere.wordfast.com/wfa/api" method="post">
 
   Key: <input type="text" id="key" name="key" value="example@key"/>
 
   Key: <input type="text" id="key" name="key" value="example@key"/>
 
   Command: <input type="text" id="cmd" name="cmd" value="9"/>
 
   Command: <input type="text" id="cmd" name="cmd" value="9"/>
Line 58: Line 58:
  
 
==== get ====
 
==== get ====
  www.freetm.com/wfa/api?key=example@key&cmd=9&tmId=1&tuId=88474b70-5f70-11e4-aad0-5c539f6f39a2
+
  anywhere.wordfast.com/wfa/api?key=example@key&cmd=9&tmId=1&tuId=88474b70-5f70-11e4-aad0-5c539f6f39a2
  
 
=== Response example ===  
 
=== Response example ===  

Latest revision as of 10:00, 17 January 2024

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", "anywhere.wordfast.com/wfa/api", true);
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.send(JSON.stringify(data));

post

<form action="anywhere.wordfast.com/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

anywhere.wordfast.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