...
Code Block |
---|
POST https://www.wordbee-translator.com/api/auth/token BODY (json): {"accountid": "{your account id}", "key": "{your API key}"} => returns token (string) |
...
Note: A token automatically expires after a period of inactivity of 30 minutes.
Example of authenticating using C# and the RestSharp library
Code Block |
---|
var client = new RestClient("{{API2URL}}"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{"accountid": "{{PLATFORMID}}", "key": "{{API2KEY}}"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); |