# 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"
}
```
