# Get an account's information

## Get an account's information

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

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | Account ID  |

#### Query Parameters

| Name  | Type   | Description                  |
| ----- | ------ | ---------------------------- |
| token | string | Account Authentication Token |

{% tabs %}
{% tab title="200 Get the information successfully" %}

```javascript
// Response Code "00". 
// Return data:
{
    "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  Query is missing request parameter or account not found" %}

```javascript
// Response Code "02". No id provided. 
// Return data:
{
    "respCode": "02",
    "user": null,
    "msg": "No id"
}


// Response Code "03". No token provided. 
// Return data:
{
    "respCode": "03",
    "user": null,
    "msg": "No token"
}


// Response Code "07". Account not found. 
// Return data:
{
    "respCode": "03",
    "user": null,
    "msg": "User not found"
}

```

{% endtab %}

{% tab title="401  Fail to verify your account" %}

```javascript
// Response Code "05". The token is invalid or has expired. 
// Return data:
{
    "respCode": "05",
    "user": null,
    "msg": "Invalid token || Token has expired"
}
```

{% endtab %}

{% tab title="403 Your account is not authorized to execute this query" %}

```javascript
// Response Code "06". Your account is not authorized to execute this query.
// Return data:
{
    "respCode": "06",
    "user": null,
    "msg": "Your account does not have permission"
}
```

{% endtab %}

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

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

{% endtab %}

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

```javascript
// Response Code "04". Server not able to authenticate your account. 
// Return data:
{
    "respCode": "04",
    "user": null,
    "msg": "Server not able to authenticate your account"
}
```

{% endtab %}
{% endtabs %}

Example:

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