AuthorizationApi. Android
Api to login to the app.
Login
Login to your application. See VMSCaptcha
to know if you need captcha information for this request.
If you receive 429 error, that means you need to delete session. For that repeat this request with sessionId parameter that you can take from error.
See ApiError
details for that information.
If request was successful you'll VMSLoginResponse
object.
@POST(TOKEN)
suspend fun login(@Body loginRequest: VMSLoginRequest): VMSLoginResponse
VMSLoginRequest
Object with needed information for login request.
login
- user's login
password
- user's password
session_id
- session you want to replace with the new one
captcha
- captcha user entered from image
key
- captcha key received from server
Get captcha
If you need captcha fo login make this request at first to get it.
If request was successful you'll VMSCaptcha
object.
There are 20 attempts to send a request getCaptcha() from one IP address within 10 minutes.
@GET(CAPTCHA)
suspend fun getCaptcha(): VMSCaptcha
VMSCaptcha
Object you receive from server with needed captcha information for login.
key
- captcha key needed to login with captcha
img
- base64 representation on captcha image, you can converts received img data into image
ttl
- valid timme of living of requested captcha