Login
Most APIs require an authenticated user who is identified by a token. To obtain a token, call the following API and use the returned value in all subsequent calls. Each token is valid for 24 hours.
When 2-factor authentication is enabled and a code
parameter is missing or invalid, the server returns the following error: AuthAccountTwoFactorProtected
.
action: api/v3/auth/login userName string password string code string O // if 2-factor authentication is enabled response: JSON { "user": { "id":30, "firstName": "Admin", "lastName": "Istrator", "userName": "admin", "role":"Admin", // ADMIN, LINGUIST, PROJECT_MANAGER } "token":"30-a3bf70333f8f1316cb7841cd774c9ce8", "expires":"2014-12-12T16:55:02Z" }
Login Another User
This creates a token for a user within your organization; only Admins may use this API call.
The token can be used to log the user in to the Web User Interface using the following URL. After the token is used in authByToken, it is deleted and cannot be used any longer.
https://cloud.memsource.com/web/login/authByToken?token=<token>&url=<url>
action: api/v3/auth/loginOther token string userName string response: JSON { "user": { "id":35, "firstName": "Linguist", "lastName": "Lingo", "userName": "linguist", "role":"Linguist", // ADMIN, LINGUIST, PROJECT_MANAGER } "token":"35-a3bf70333f8f1316cb7841cd774c9ce8", "expires":"2014-12-12T16:55:02+0000" }
Logout
action: api/v3/auth/logout token string response: empty
Who Am I
This API call can be used to test if the previous auth/login call went ok. Although this API does not provide any essential functionality, it may still be useful during development.
action: api/v3/auth/whoAmI token string response: JSON { "user": { "id":30, "firstName": "Admin", "lastName": "Istrator", "userName": "admin", "role":"Admin", // ADMIN, LINGUIST, PROJECT_MANAGER } }
Comments
Article is closed for comments.