Difference between revisions of "DeleteTerm"

From Wordfast Wiki
Jump to: navigation, search
(Returned value)
 
(DeleteTerm)
 
Line 44: Line 44:
 
  data["termId"] = "88474b70-5f70-11e4-aad0-5c539f6f39a2";
 
  data["termId"] = "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="53"/>
 
   Command: <input type="text" id="cmd" name="cmd" value="53"/>
Line 58: Line 58:
  
 
==== get ====
 
==== get ====
  www.freetm.com/wfa/api?key=example@key&cmd=53&gloId=1&termId=88474b70-5f70-11e4-aad0-5c539f6f39a2
+
  anywhere.wordfast.com/wfa/api?key=example@key&cmd=53&gloId=1&termId=88474b70-5f70-11e4-aad0-5c539f6f39a2
  
 
=== Response example ===  
 
=== Response example ===  

Latest revision as of 10:01, 17 January 2024

Return to command list

DeleteTerm

deleteTerm (string key, int cmd, int gloId, string termId)

Delete a terminology entry in the given glossary.

Parameters

key string a valid API Key, generated by making a share at www.freetm.com
cmd int command number is 53
gloId int glossary ID
termId string term ID coming from the last recent search. CAUTION, a search must done before deleting to get a valid termId.

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"] = 53;
data["gloId"] = 1;
data["termId"] = "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="53"/>
 Glo Id: <input type="text" id="gloId" name="gloId"/>
 Term Id: <input type="text" id="termId" name="termId"/>
 <input type="submit" value="Submit">
</form>

get

anywhere.wordfast.com/wfa/api?key=example@key&cmd=53&gloId=1&termId=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