# Lấy thông tin một tài khoản

## Lấy thông tin một tài khoản

<mark style="color:blue;">`GET`</mark> `https://abc.hoola.vn/manage/api/user/get-single-user/:id`

#### Path Parameters

| Name | Type   | Description                    |
| ---- | ------ | ------------------------------ |
| id   | string | ID tài khoản cần lấy thông tin |

#### Query Parameters

| Name  | Type   | Description                      |
| ----- | ------ | -------------------------------- |
| token | string | Token xác thực tài khoản của bạn |

{% tabs %}
{% tab title="200 Lấy thông tin tài khoản thành công" %}

```javascript
Mã phản hồi respCode "00". Data trả về  
{
    "respCode": "00",
    "user": {
        "_id": "73chhLtPnxpPoekrx",
        "createdAt": "2021-05-27T08:38:15.067Z",
        "username": "vuvanhoang",
        "emails": [
            {
                "address": "hoangvuvan@abc.com",
                "verified": false
            }
        ],
        "profile": {
            "name": "Vu Van Hoang"
        },
        "myCourses": [
            {
                "courseId": "wSZpqbtWowmpLC68L",
                "activatedDate": "2021-05-29T06:19:24.107Z",
                "expiredAt": "2121-05-05T06:19:24.107Z"
            }
        ],
        "myCart": [
            {
                "courseId": "vivPteJNNC2P94Es8",
                "status": "DELETED"
            }
        ],
        "myTransactions": [
            "nTv5XgDMNcMLBuRM5"
        ]
    },
    "msg": "Success"
}
```

{% endtab %}

{% tab title="400  Truy vấn thiếu tham số yêu cầu hoặc không tìm thấy tài khoản " %}

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


Mã phản hồi respCode "03". Không có tham số token tài khoản của bạn. Data trả về 
{
    "respCode": "03",
    "user": null,
    "msg": "No token"
}


Mã phản hồi respCode "07". Không tìm thấy tài khoản cần truy vấn. Data trả về 
{
    "respCode": "03",
    "user": null,
    "msg": "User not fount"
}

```

{% endtab %}

{% tab title="401  Xác thực tài khoản của bạn không thành công" %}

```javascript
Mã phản hồi respCode "05". Token xác thực tài khoản của bạn không có hiệu lực hoặc đã hết hạn. Data trả về
{
    "respCode": "05",
    "user": null,
    "msg": "Invalid token || Token has expired"
}
```

{% endtab %}

{% tab title="403  Tài khoản của bạn không được phân truyền thực hiện truy vấn này  " %}

```javascript
Mã phản hồi respCode "06". Tài khoản của bạn không được phân quyền cho truy vẫn này. Data trả về 
{
    "respCode": "06",
    "user": null,
    "msg": "Your account does not have permission"
}
```

{% endtab %}

{% tab title="405  Phương thức truy vấn không hợp lệ " %}

```javascript
Mã phản hồi respCode "01". Phương thức không hợp. Data trả về 
{
    "respCode": "01",
    "user": null,
    "msg": "Request method should be GET"
}
```

{% endtab %}

{% tab title="500  Có lỗi từ server" %}

```javascript
Mã phản hồi respCode "04". Lỗi server, không xác thực được tài khoản của bạn. Data trả về 
{
    "respCode": "04",
    "user": null,
    "msg": "Server not able to authenticate your account"
}
```

{% endtab %}
{% endtabs %}

Ví dụ về lấy thông tin một tài &#x20;

```javascript
GET: 
https://abc.hoola.vn/manage/api/users/get-single-user/124khsdkgh7574?token=kshfk295xkjvbk0929375knxcbvk9895792
```


---

# 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/master/ket-noi-api/get-single-user.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.
