Search accounts

Search accounts using email or username

Search accounts

GET https://abc.hoola.vn/manage/api/users/search-user

To execute the query, there must be at least 1 parameter, either the email or username of the account. When there are both email and username parameters at the same time, the account will be prioritized to search by email first. If there is no match by email, it will continue to search for accounts by username.

Query Parameters

// Response Code "00". Query successfully.
// 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"
}

Example

// Search for an account by email
// GET:
https://abc.hoola.vn/manage/api/users/search-user?token=sdhg23797sdbv9186jdvk58&email=abc@abc.com


// Search for an account by username
// GET:
https://abc.hoola.vn/manage/api/users/search-user?token=sdhg23797sdbv9186jdvk58&username=abc


// Search for an account by both email and username
// GET:
https://abc.hoola.vn/manage/api/users/search-user?token=sdhg23797sdbv9186jdvk58&email=abc@abc.com&username=abc

Last updated