# Login

## &#x20;Login

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

#### Request Body

| Name     | Type   | Description   |
| -------- | ------ | ------------- |
| email    | string | Email Address |
| password | string | Password      |

{% tabs %}
{% tab title="200 Login successfully" %}

```javascript
// Response Code "00". Login successfully. 
// Return data:
{
   respCode: "00",
   token: "6KxGr8LJzlixGIUskGv3VodeFI9u8fWtPs3no3Q3S3h",
   tokenExpires: "2021-06-14T08:51:23.685Z",
   msg: "login success",
}
```

{% endtab %}

{% tab title="400  Login unsuccessfully" %}

```javascript
// Response Code "02". No request body. 
// Return data:
{ respCode: "02", msg: "No request body" }


// Response Code "03". No email in the request body. 
// Return data:
{ respCode: "03", msg: "No email in request body" }


// Response Code "04". No password in the request body. 
// Return data:
{ respCode: "04", msg: "No password in request body" }


// Response Code "05". Wrong email. 
// Return data:
{ respCode: "05", msg: "Wrong email" }


// Response Code "07". Wrong password. 
// Return data:
{ respCode: "07", msg: "Wrong password" }
```

{% endtab %}

{% tab title="405  Wrong request method" %}

```javascript
// Response Code "02". Wrong request method. 
// Return data:
{ respCode: "01", msg: "Request method should be POST" }
```

{% endtab %}

{% tab title="500  Server error" %}

```javascript
// Response Code "06". Server not able to check password. 
// Return data:
{
    respCode: "06",
    msg: "Server not able to check password",
}


// Response Code "08". Server not able to generate token. 
// Return data:
{
    respCode: "08",
    msg: "Server not able to generate token"
}
```

{% endtab %}
{% endtabs %}

Example:

```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/english/api/login.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.
