# Đăng nhập

## &#x20;Đăng nhập

<mark style="color:green;">`POST`</mark> `https://abc.hoola.vn/manage/api/users/login-user`

#### Request Body

| Name     | Type   | Description             |
| -------- | ------ | ----------------------- |
| email    | string | Email của tài khoản     |
| password | string | Mật khẩu của tài  khoản |

{% tabs %}
{% tab title="200 Đăng nhập thành công" %}

```javascript
Mã phản hồi respCode "00". Đăng nhập thành công, trả về token
và thời gian hết hạn. Data trả về
{
   respCode: "00",
   token: "6KxGr8LJzlixGIUskGv3VodeFI9u8fWtPs3no3Q3S3h",
   tokenExpires: "2021-06-14T08:51:23.685Z",
   msg: "login success",
}
```

{% endtab %}

{% tab title="400  Đăng nhập không thành công" %}

```javascript
Mã phản hồi respCode "02". Không có tham số trong body. Data trả về
{ respCode: "02", msg: "No request body" }


Mã phản hồi respCode "03". Không có tham số email trong body. Data trả về
{ respCode: "03", msg: "No email in request body" }


Mã phản hồi respCode "04". Không có tham số password trong body. Data trả về
{ respCode: "04", msg: "No password in request body" }


Mã phản hồi respCode "05". Sai email. Data trả về
{ respCode: "05", msg: "Wrong email" }


Mã phản hồi respCode "07". Sai mật khẩu. Data trả về
{ respCode: "07", msg: "Wrong password" }
```

{% endtab %}

{% tab title="405  Sai phương thức " %}

```javascript
Mã phản hồi respCode "02". Sai phương thức request. Data trả về
{ respCode: "01", msg: "Request method should be POST" }
```

{% endtab %}

{% tab title="500  Lỗi server" %}

```javascript
Mã phản hồi respCode "06". Server không kiểm tra được mật khẩu. Data trả về
{
    respCode: "06",
    msg: "Server not able to check password",
}


Mã phản hồi respCode "08". Server không tạo được token đăng nhập. Data trả về
{
    respCode: "08",
    msg: "Server not able to generate token"

```

{% endtab %}
{% endtabs %}

Ví dụ đăng nhập:&#x20;

```javascript
POST: 
https://abc.hoola.vn/manage/api/users/login-user

body: 
{
    email: "abc@abc.com",
    password: "1234567890"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hoola.vn/ket-noi-api/dang-nhap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
