Body Params
| Name | Type | Required | Description | Default |
|---|---|---|---|---|
userName | string | Required | Tên đăng nhập | - |
password | string | Required | Mật khẩu | - |
Path Params
| Name | Type | Required | Description | Default |
|---|
Query Params
| Name | Type | Required | Description | Default |
|---|
Headers
| Header | Required | Description | Example |
|---|
Response
200Đăng nhập thành công
| Trường | Kiểu | Mô tả |
|---|---|---|
| accessToken | string | JWT token truy cập |
| refreshToken | string | JWT token làm mới |
| user | object | Thông tin người dùng |
401Sai thông tin đăng nhập
| Trường | Kiểu | Mô tả |
|---|---|---|
| error | string | Thông báo lỗi |
example.title:
{
"200": {
"accessToken": "accessToken",
"info": {
"id": 0,
"name": "Sample User",
"username": "SAMPLE_USER",
"status": 1,
"adminProduct": false,
"customerId": "",
"departmentId": null
},
"type": "BEARER"
}
}API Request
POST
https://troly.mobifone.vn/api/v1/auth/loginTry It Out
Test Endpoint
const axios = require('axios');
let data = JSON.stringify({
"userName": "sample_user",
"password": "samplepassword"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://troly.mobifone.vn/api/v1/auth/login',
headers: {
'Content-Type': 'application/json',
'Cookie': 'sessionId=fsReYwWzkBSdPJ0ExqFoqhOwCuOTh9GyUZL10WVgxM86iuWg2SKZNqL5Fu8k0fzZZky7HyJPxCSq+Gtwugu01dLwlFW0aEGe5tnNnkcQYXWby/Px50wDQyk3dyWzffMwLdNJ1KwVTYJvXTkI05Z2f7S0Ioko1NkqpHzuCu+CYTQahGeBTniscvU6QrKdOkyMQxv1wVBux0TUVP+G57KCv9JCiUg44VeV7LDMUPE6TVY='
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});