Authentication

The API 2 endpoint is your Wordbee Translator URL + /api

Please make sure to use the endpoint that applies to your platform throughout this documentation. Read more


Auth token mechanism

Authenticate and obtain token

All the API methods currently use a token based mechanism.

To use the API, the user first has to obtain a token. Submit the following call with your Account Id and an API Key:

  • accountid: The code of your Wordbee platform. It is the same code you type in the login screen.
  • key: Identifies a Wordbee Translator user. If you do not have one yet create one now: Creating API keys


POST https://www.wordbee-translator.com/api/auth/token
BODY (json):
{"accountid": "{your account id}", "key": "{your API key}"} 

 => returns token (string)

Note: Each API Key is linked to a specific user. The token thus allows access to exactly the same data which the user can access online (see user's access rights and profile).


Calling API methods

With all API methods you must include the HTTP header below and fill in the token:

X-Auth-Token {your token}
X-Auth-AccountId {your account id}

Example:

X-Auth-Token 61094C3A-F44F-4D5C-AD34-1D5185EFFE94
X-Auth-AccountId supertrans


Invalidate token

It is recommended to invalidate your token when you are done with calling the API methods:

DELETE https://www.wordbee-translator.com/api/auth/token

In the HTTP header include:

X-Auth-Token {your token}
X-Auth-AccountId {your account id}

Note: A token automatically expires after a period of inactivity of 30 minutes.

Example of authenticating using C# and the RestSharp library

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);

Copyright Wordbee - Buzzin' Outside the Box since 2008