The session API is located in the editor module, it enables authentication to translate5 via API.
Provides status informations about the authenticated user.
URL: | /editor/session/[SESSION_ID] |
Available Methods: | GET/POST |
Specialities: | See below |
POST Request
The POST requests needs the following two parameters either as data object or plain form parameters:
Name | Type | Info |
login | string | The user to be authenticated. |
passwd | string | The passwd of the user to be authenticated. |
POST resulting resource layout
Returns HTTP 200 when login was successful, 400 when parameters are missing, 403 when credentials were wrong.
When successful the result looks like:
Name | Type | Info |
sessionId | string | the sessionId of the newly created session, can be used directly for further API communication. |
sessionToken | string | A one time usable token which can be passed to the users browser for overtaking the created session. For example: Users are administered by your software, translate5 is just embedded. |
GET resulting resource layout
For GET the sessionId must be part of the URL, like the usual ID parameter.
Returns HTTP 200 when user is authenticated, 404 otherwise.
Name | Type | Info |
state | string | contains "authenticated" or "not authenticated" |
user | object | contains the authenticated user or null. The users structure is as described in the user API. |