Disconnect

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

Return to command list

disconnect

disconnect (string key, int cmd)

Disconnect all the TMs and glossaries.

Parameters

key string a valid API Key, generated by making a share at www.freetm.com
cmd int command number is 25

Returned value

connections array Disconnect error by connection if any
id int connection ID
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"] = 25;
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.com/wfa/api" method="post">
   <input type="text" id="key" name="key" value="example@key"/>
   <input type="text" id="cmd" name="cmd" value="25"/>	
   <input type="submit" value="Submit">				
</form>

get

www.freetm.com/wfa/api?key=example@key&cmd=25

Response example

json

{
   "connections": [
            {
                 "id":      1
                 ,"success": true
                 ,"error":  ""
            }
            ,{
                 "id":      2
                 ,"success": false
                 ,"error":  "unknown error"
            }
            ,{...}
   ]      
}

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

text

1 : true LF
2 : unknown error LF

LF is a Line feed (new line \u000A)

Remarks

Timeout is 30 seconds