Add multiple courses to multiple users

Add multiple courses to multiple users

POST https://abc.hoola.vn/manage/api/courses/add-multi-course-to-multi-user

To avoid timeout requests and make it easier to track results, only add courses to a maximum of 100 accounts in one query.

Query Parameters

NameTypeDescription

token

string

Account Authentication Token

Request Body

NameTypeDescription

users

array

An array of User ID

courses

array

An array of Course ID

// Response Code "00". Query successfully. 
// Return data:
{
    "respCode": "00",
    "validCourses": [
        {
            "_id": "2LnbF77cmzF5J8bHE",
            "title": "Trắc nghiệm"
        },
        {
            "_id": "vivPteJNNC2P94Es8",
            "title": "15 Thủ Pháp Thị Giác Trong Nhiếp Ảnh"
        }
    ],
    "result": [
        {
            "userId": "urs2vByNw9ETg9XYZ",
            "success": true,
            "status": "Success"
        },
        {
            "userId": "cc95fXX5PTX5qDR9R",
            "success": true,
            "status": "Success"
        },
        {
            "userId": "MPC5B5dsdYD9Ak283",
            "success": true,
            "status": "Success"
        },
        {
            "userId": "msnJmaPa7KmtEzz3q",
            "success": true,
            "status": "Success"
        }
    ],
    "msg": "4 tài khoản thêm khoá học thành công, 0 tài khoản thêm khoá học lỗi"
}

Example:

// GET:
https://abc.hoola.vn/manage/api/courses/add-multi-course-to-multi-user?token=sdhg23797sdbv9186jdvk58

body: {
    users: ["msnJmaPa7KmtEzz3q", "cc95fXX5PTX5qDR9R", "urs2vByNw9ETg9XYZ", "MPC5B5dsdYD9Ak283"],
    courses: ["vivPteJNNC2P94Es8", "2LnbF77cmzF5J8bHE"]
}

Last updated