Skip to main content
Version: 2.2.0

Login

Updated date: 19/05/2023
Updated by: VNPT eContract's team


Purpose

Obtain the token code information to access APIs that require authentication.

  • Request URL: api/v2/auth/password-login
  • HTTP method: POST
  • HTTP content-type: application/json
  • Parameter:
KeyTypeDescription
usernamestring[Required] Username of user
passwordstring[Required] Password of user

Sample request

{
"username": "congtyABC@email.com",
"password": "123456"
}

Sample response body

{
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9……",
"success": true,
"code": 0,
"messages": [
"Authenticate and choose company success"
]
}
Caution
  • If the account only manages one company, the system will automatically select the company after calling this API.
  • If the account manages multiple companies, after calling this API, you need to call the choose-company API to determine the processing operation within which company.

Return code

CodeDescription
200 (OK)Success
401 (Unauthorized)Token is wrong or expired
502 (Bad Gateway)Timeout