NAV
shell ruby python javascript

Introduction

Welcome to the BrainCert LMS API! You can use our API to access BrainCert LMS endpoints to automate and integrate various LMS features. Every request must include an API Key and a Domain ID, which are unique to your LMS instance.

Overview

The BrainCert LMS API follows standard HTTP methods, supporting Create, Read, Update, and Delete operations across a wide range of LMS resources such as users, groups, courses, bundles, tests, live classes, andenrollments.

Each request must include both an API Key and a Domain ID, which are unique to your BrainCert LMS instance. These credentials ensure secure and authenticated access to your LMS resources.

All requests must be made over HTTPS for secure communication. You can generate your API key by navigating to Global Settings and then to Basic Settings, whereyou'll find the 'API Key' tab.

Request Format

Example request:

curl -X POST "https://lms.braincert.com/api/v1/users/create" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"username": "testuser", "email": "[email protected]"}'

All API requests should be made over HTTPS to ensure secure transmission of data. You can pass parameters in the POST body or as query string parameters.

API requests follow this structure:

POST https://lms.braincert.com/api/v1/{endpoint}

Best Practices

We recommend using the following tools and techniques to test and interact with the BrainCert LMS API:

Future Roadmap

We're continually improving our API to provide more functionality. In the future, we plan to introduce additional RESTful features, allowing more advanced integrations with even greater flexibility.

If you have any questions, or need assistance using the API, feel free to reach out to our support team at [email protected]. We're here to help!

Authentication

To authorize, use this example code:

curl "https://lms.braincert.com/api/v1/users/create" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"username":"testuser", "email":"[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
import braincert

api = braincert.authorize('API_KEY')
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');

Make sure to replace API_KEY and DOMAIN_ID with your API key.

BrainCert LMS uses API keys along with a Domain ID to authenticate requests to the API. You can generate your API key in the 'Global Settings' and 'Basic Settings' section of your BrainCert LMS account.

BrainCert expects both the API key and Domain ID to be included in all API requests in the headers, formatted as follows:

Authorization: API_KEY

x-domain-id: DOMAIN_ID

Users

Create User

Create a user in the LMS using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/users/create" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"username": "testuser", "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.users.create(username: "testuser", email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.users.create(username="testuser", email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.users.create({username: "testuser", email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User successfully created",
  "id": 12345
}

HTTP Request

POST https://lms.braincert.com/api/v1/users/create

Parameters

Parameter Type Description
username string The username of the new user
email string The email address of the new user

Delete User

Delete a user from the LMS using the following code example:

curl -X DELETE "https://lms.braincert.com/api/v1/users/delete" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.users.delete(email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.users.delete(email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.users.delete({email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User deleted successfully"
}

HTTP Request

DELETE https://lms.braincert.com/api/v1/users/delete

Parameters

Parameter Type Description
email string The email address of the user to delete

User List

List a user from the LMS using the following code example:

  curl -X POST "https://lms.braincert.com/api/v1/users/list" \
 -H "authorization: API_KEY" \
 -H "x-Domain-id: DOMAIN_ID" \
 -d '{"name": "testuser", "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.users.list( name: "testuser", email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.user.list(groupId="123", email="[email protected]")

const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.user.list({name: "Group Name", description: "Group Description"});

The above command returns JSON structured like this:

{
  "message": "Users retrieved successfully",
  "data": [
    {
      "id": 1234,
      "name": "name",
      "username": "username",
      "email": "[email protected]"
    }
  ]
}

HTTP Request

https://lms.braincert.com/api/v1/users/list

Parameters

Parameter Type Description
name string The name of the user
email string The email address of the user

Get User By ID

Get user by ID from the LMS using the following code example:

curl -X GET "https://lms.braincert.com/api/v1/users/getuser" \
  -H "Authorization: cy2MOLYV0QSZLkv2Oq3xFRIvoCFF83I1j4Zh8DU0" \
  -H "x-domain-id: DOMAIN_ID" \ 
  -d '{"userId": USER_ID}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.get.users.id(email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.get.users.id(name="Group Name", description="Group Description")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.get.users.id({name: "Group Name", description: "Group Description"});

The above command returns JSON structured like this:

{
  "message": "User retrieved successfully",
  "data": [
    {
      "id": 1234,
      "name": "name",
      "username": "[email protected]",
      "email": "[email protected]"
    }
  ]
}

HTTP Request

https://lms.braincert.com/api/v1/users/getuser

Parameters

Parameter Type Description
userId number The ID of the user

Get User By Email

Get a user by email by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/users/getuserbyEmail/USER_EMAIL’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \

require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')
api.users.get_by_email("[email protected]")
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.users.get_by_email("[email protected]")
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.users.getByEmail("[email protected]")
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
  "message": "User retrieved successfully",
  "data": [
    {
      "id": 1234,
      "name": "name",
      "username": "name",
      "email": "[email protected]"
    }
  ]
}

HTTP Request

https://lms.braincert.com/api/v1/users/getuserbyEmail

Get Users Entrolled In Course

Get a users entrolled in course by using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/users/listUsersenrolledincourse" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -d {"user_id=USER_ID","lms_domain_id=DOMAIN_ID"} \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.users.list_enrolled_in_course(
  user_id: 'USER_ID',
  lms_domain_id: 'DOMAIN_ID'
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.users.list_enrolled_in_course(
    user_id='USER_ID',
    lms_domain_id='DOMAIN_ID'
)

const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.users.listEnrolledInCourse({
  user_id: 'USER_ID',
  lms_domain_id: 'DOMAIN_ID'
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
  "message": "User retrived successfully",
  "data":  [ 
     {
            "count": 3
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/users/listUsersenrolledincourse

Parameter

Parameter Type Description
user_id number The ID of the user
lms_domain_id number Your Domain identifier

Get User Entrolled In Test

Get a users entrolled in test by using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/users/listUsersenrolledintest" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -d {"user_id= USER_ID","lms_domain_id= DOMAIN_ID"} \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.users.list_enrolled_in_test(
  user_id: 'USER_ID',
  lms_domain_id: 'DOMAIN_ID'
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.users.list_enrolled_in_test(
    user_id='USER_ID',
    lms_domain_id='DOMAIN_ID'
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.users.listEnrolledInTest({
  user_id: 'USER_ID',
  lms_domain_id: 'DOMAIN_ID'
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Users retrieved successfully",
    "data": [
        {
            "count": 3
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/users/listUsersenrolledintest

Parameters

Parameter Type Description
user_id number The ID of the user
lms_domain_id number Your domain identifier

Get users enrolled in class

Get a users entrolled in class by using the following code example:

{
 curl -X POST "https://lms.braincert.com/api/v1/users/listUsersenrolledinclass" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -d {"user_id=USER_ID","lms_domain_id=DOMAIN_ID"} \
}
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.users.list_enrolled_in_class(
  user_id: 'USER_ID',
  lms_domain_id: 'DOMAIN_ID'
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.users.list_enrolled_in_class(
    user_id='USER_ID',
    lms_domain_id='DOMAIN_ID'
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.users.listEnrolledInClass({
  user_id: 'USER_ID',
  lms_domain_id: 'DOMAIN_ID'
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Users retrieved successfully",
    "data": [
        {
            "count": 1
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/users/listUsersenrolledinclass

Parameters

Parameter Type Description
user_id number The ID of the user
lms_domain_id number Your domain identifier

Groups

Create group

Create a new group by using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/groups/create" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"name": "Group Name", "description": "Group Description"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.groups.create(name: "Group Name", description: "Group Description")
import braincert

api = braincert.authorize('API_KEY')
api.groups.create(name="Group Name", description="Group Description")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.groups.create({name: "Group Name", description: "Group Description"});

The above command returns JSON structured like this:

{
  "message": "Group created successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/groups/create

Parameters

Parameter Type Description
name string The name of the group
description string The description of the group

Add user to group

Add a user to a group using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/groups/addUser" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"groupId": 123, "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.groups.addUser(groupId: 123, email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.groups.addUser(groupId=123, email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.groups.addUser({groupId: 123, email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User added to group successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/groups/addUser

Parameters

Parameter Type Description
groupId int The ID of the group
email string The email address of the user

Group list

Get a group list by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/groups/list' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.groups.list
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.groups.list()
onst BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.groups.list()
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
    "message": "Groups retrieved successfully",
    "data": [
        {
            "id": 123,
            "group_id": 123,
            "group_name": "Bundle Access"
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/groups/list

List all users in group

Get list of all users in group by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/groups/listallusers' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
  -d {'groupId= GROUP_ID'}
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.groups.list_all_users(
  group_id: 'GROUP_ID'
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.groups.list_all_users(
    group_id='GROUP_ID'
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.groups.listAllUsers({
  group_id: 'GROUP_ID'
})
.then(res => console.log(res))
.catch(err => console.error(err));
{
    "message": "Users retrieved successfully",
    "data": [
        {
            "id": 1234,
            "user_type": "0",
            "name": "name",
            "email": "[email protected]",
            "thumb": "thumbnail",
            "aid": 1234
        },
  ]
}

HTTP Request

https://lms.braincert.com/api/v1/groups/listallusers

Parameters

Parameter Type Description
groupId number The unique identifier of a group

Courses

Enroll user to course

Enroll a user into a course using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/courses/enroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"courseId": 123, "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.courses.enrollUser(courseId: 123, email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.courses.enrollUser(courseId=123, email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.courses.enrollUser({courseId: 123, email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User enrolled in course successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/courses/enroll

Parameters

Parameter Type Description
courseId int The ID of the course
email string The email address of the learner

Unenroll user from course

Unenroll a user from a course using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/courses/unenroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"courseId": 123, "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.courses.unenrollUser(courseId: 123, email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.courses.unenrollUser(courseId=123, email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.courses.unenrollUser({courseId: 123, email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User unenrolled from course successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/courses/unenroll

Parameters

Parameter Type Description
courseId int The ID of the course
email string The email address of the learner

Course list

Get a course list by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/courses/list' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.list
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.list()
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.list()
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Courses retrieved successfully",
    "data": [
        {
            "id": 1234,
            "course_id": 1234,
            "course_name": "Course Title"
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/courses/list

Get course

Get a course by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/courses/get/COURSE_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.get(course_id: 'COURSE_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.get(course_id='COURSE_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.get({ course_id: 'COURSE_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
  "message": "Course retrieved successfully",
  "data": {
    "id": 1234,
    "title": "title",
    "subtitle": "subtitle",
  }
}

HTTP Request

https://lms.braincert.com/api/v1/courses/get/COURSE_ID

Create course

Create a course by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/courses/create' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID' \
  -d '{
    "course_name": "test",
    "subtitle": "subtitle  test",
    "instructor_description": "instructor_description  test",
    "highlight": "highlights test",
    "description": "description test"
}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.create(
  course_name: "test",
  subtitle: "subtitle test",
  instructor_description: "instructor_description test",
  highlight: "highlights test",
  description: "description test"
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.create(
    course_name="test",
    subtitle="subtitle test",
    instructor_description="instructor_description test",
    highlight="highlights test",
    description="description test"
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.create({
  course_name: "name",
  subtitle: "subtitle",
  instructor_description: "instructor description",
  highlight: "highlights",
  description: "description"
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Course created successfully",
    "data": {
        "course_id": 1234,
        "course_name": "name",
        "subtitle": "subtitle",
        "instructor_description": "instructor description",
        "highlight": "highlights",
        "description": "description"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/courses/create

Parameters

Parameter Type Description
course_name string The name of the course
subtitle string The subtitle or short summary of the course
instructor_description string A description of the instructor
highlight string Key highlights or selling points of the course
description string A detailed description of the course

Update course

Update a course by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/courses/update' \
  -H 'Authorization: API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'x-Domain-id: DOMAIN_ID' \
  -d '{
    "course_id": 1234,
    "course_name": " Course Title",
    "alias": "alias",
    "subtitle": "Course Subtitle",
}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.update(
  course_id: 1234,
  course_name: "Course Title",
  alias: "alias",
  subtitle: "Course Subtitle",
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.update(
    course_id=1234,
    course_name="Course Title",
    alias="alias",
    subtitle="Course Subtitle",
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.update({
  course_id: 1234,
  course_name: "Course Title",
  alias: "alias",
  subtitle: "Course Subtitle",
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Course updated successfully",
    "data": {
        "course_id": 1234,
        "course_name": "Course Title",
        "alias": "alias",
        "subtitle": "Subtitle",
   }
}

HTTP Request

https://lms.braincert.com/api/v1/courses/update

Parameters

Parameter Type Description
name string The name of the course category

Delete Course

Delete a course by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/courses/delete/COURSE_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.delete(course_id: 'COURSE_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.delete(course_id='COURSE_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.delete({ course_id: 'COURSE_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Course deleted successfully",
    "data": {
        "id": 1234
    }

}

HTTP Request

https://lms.braincert.com/api/v1/courses/delete/COURSE_ID

Course publish

Publish a course by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/courses/publish/COURSE_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.publish(course_id: 'COURSE_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.publish(course_id='COURSE_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.publish({ course_id: 'COURSE_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Course published successfully",
    "data": {
        "id": 1234,
        "status": "published"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/courses/publish/COURSE_ID

Course Unpublish

Unpublish a course by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/courses/unpublish/COURSE_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.courses.unpublish(course_id: 'COURSE_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.courses.unpublish(course_id='COURSE_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.courses.unpublish({ course_id: 'COURSE_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Course unpublished successfully",
    "data": {
        "id": 1234,
        "status": "Unpublished"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/courses/unpublish/COURSE_ID

Live classes

Create live class

Create a new live class using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/liveClasses/create" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"title": "Live Class Title", "date": "2024-01-01", "startTime": "09:00", "endTime": "11:00", "timezone": "UTC"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.liveClasses.create(title: "Live Class Title", date: "2024-01-01", startTime: "09:00", endTime: "11:00", timezone: "UTC")
import braincert

api = braincert.authorize('API_KEY')
api.liveClasses.create(title="Live Class Title", date="2024-01-01", startTime="09:00", endTime="11:00", timezone="UTC")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.liveClasses.create({title: "Live Class Title", date: "2024-01-01", startTime: "09:00", endTime: "11:00", timezone: "UTC"});

The above command returns JSON structured like this:

{
  "message": "Live class created successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/liveClasses/create

Parameters

Parameter Type Description
title string The title of the live class
date string The date of the live class (YYYY-MM-DD)
startTime string The start time of the class (HH)
endTime string The end time of the class (HH)
timezone string The timezone of the live class

Enroll user to live class

Enroll a user into a live class using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/liveClasses/enroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"classId": 123, "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.liveClasses.enrollUser(classId: 123, email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.liveClasses.enrollUser(classId=123, email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.liveClasses.enrollUser({classId: 123, email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User enrolled in live class successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/liveClasses/enroll

Parameters

Parameter Type Description
classId int The ID of the live class
email string The email address of the learner

Unenroll user from live class

Unenroll a user from a live class using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/liveClasses/unenroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"classId": 123, "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.liveClasses.unenrollUser(classId: 123, email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.liveClasses.unenrollUser(classId=123, email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.liveClasses.unenrollUser({classId: 123, email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User unenrolled from live class successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/liveClasses/unenroll

Parameters

Parameter Type Description
classId int The ID of the live class
email string The email address of the learner

Class List

Get a class list by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/liveClasses/list' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.live_classes.list
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.live_classes.list()
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.liveClasses.list()
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Classes retrieved successfully",
    "data": [
        {
            "id": 1234,
            "class_id": 1234,
            "class_name": "class name"
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/liveClasses/list

Bundles

Enroll user to bundle

Enroll a learner into a bundle using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/bundles/enroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"bundleId": "123", "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.bundles.enroll(bundleId: "123", email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.bundles.enroll(bundleId="123", email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.bundles.enroll({bundleId: "123", email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User enrolled in bundle successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/bundles/enroll

Parameters

Parameter Type Description
bundleId string The ID of the bundle
email string The email address of the learner to enroll

Unenroll user from bundle

Unenroll a learner into a bundle using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/bundles/unenroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"bundleId": "123", "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.bundles.unenroll(bundleId: "123", email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.bundles.unenroll(bundleId="123", email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.bundles.unenroll({bundleId: "123", email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User unenrolled from bundle successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/bundles/unenroll

Parameters

Parameter Type Description
bundleId string The ID of the bundle
email string The email address of the user to unenroll

Get bundle list

Get bundle list using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/bundles/list' \
  -H 'authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’
require 'net/http'
u=URI("https://lms.braincert.com/api/v1/bundles/list")
r=Net::HTTP::Post.new(u,{"authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID"})
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.post("https://lms.braincert.com/api/v1/bundles/list",
  headers={"authorization":"API_KEY","x-domain-id":"DOMAIN_ID"})
print(r.text)
fetch("https://lms.braincert.com/api/v1/bundles/list",{
  method:"POST",
  headers:{authorization:"API_KEY","x-domain-id":"DOMAIN_ID"}
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:

{
    "message": "Bundles retrieved successfully",
    "data": [
        {
            "id": 123,
            "bundle_id": 123,
            "bundle_name": "Bundle name"
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/bundles/list

Tests

Enroll user to test

Enroll a learner into a test using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/tests/enroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"testId": "123", "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.tests.enroll(testId: "123", email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.tests.enroll(testId="123", email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.tests.enroll({testId: "123", email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User enrolled in test successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/tests/enroll

Parameters

Parameter Type Description
testId string The ID of the test
email string The email address of the learner to enroll

Unenroll User from test

Unenroll a learner into a test using the following code example:

curl -X POST "https://lms.braincert.com/api/v1/tests/unenroll" \
  -H "Authorization: API_KEY" \
  -H "x-domain-id: DOMAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"testId": "456", "email": "[email protected]"}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY')
api.tests.unenroll(testId: "456", email: "[email protected]")
import braincert

api = braincert.authorize('API_KEY')
api.tests.unenroll(testId="456", email="[email protected]")
const braincert = require('braincert');

let api = braincert.authorize('API_KEY');
api.tests.unenroll({testId: "456", email: "[email protected]"});

The above command returns JSON structured like this:

{
  "message": "User unenrolled from test successfully"
}

HTTP Request

POST https://lms.braincert.com/api/v1/tests/unenroll

Parameters

Parameter Type Description
testId string The ID of the test
email string The email address of the learner to unenroll

Assessment list

Get a assessment list by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/tests/list' \
  -H 'Authorization: API_KEY' \
  -H 'x-Domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.list
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.list()
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.list()
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Assesments retrieved successfully",
    "data": [
        {
            "id": 1234,
            "testId": 1234,
            "test_name": "Test name"
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/tests/list

Get test

Get a test by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/tests/1234' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.get(1234)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.get(1234)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.get(1234)
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
  "message": "Test retrieved successfully",
  "data": {
    "id": 1234,
    "tests_name": "name",
    "tests_description": "TestDescription",
    "status": 1
  }
}

HTTP Request

https://lms.braincert.com/api/v1/tests/1234

Create Test

Create a test by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/tests/create' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
  -d '{
    "tests_name": "sample test",
    "tests_description": "A sample test description",
    "test_instructions": "Follow the instructions carefully"
  }'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.create(
  tests_name: "sample test",
  tests_description: "A sample test description",
  test_instructions: "Follow the instructions carefully"
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.create(
    tests_name="sample test",
    tests_description="A sample test description",
    test_instructions="Follow the instructions carefully",
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.create({
  tests_name: "sample test",
  tests_description: "A sample test description",
  test_instructions: "Follow the instructions carefully",
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Test created successfully",
    "data": {
        "id": 1234,
        "tests_name": "sample test",
        "tests_description": "A sample test description",
        "test_instructions": "Follow the instructions carefully"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/tests/create

Parameters

Parameter Type Description
tests_name string The name/title of the test
tests_description string A description for the test
test_instructions string Instructions to be shown to users
tests_alloted_time_demo_mode string Time allowed in demo mode (HH:MM:SS)
tests_alloted_time_test_mode string Time allowed in test mode (HH:MM:SS)

Update test

Update a test by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/tests/TEST_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
  -d '{
    "tests_name": "updated test name",
    "tests_description": "Updated test description",
    "test_instructions": "Updated instructions",
  }'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.update(
  test_id: 'TEST_ID',
  tests_name: "updated test name",
  tests_description: "Updated test description",
  test_instructions: "Updated instructions"
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.update(
    test_id='TEST_ID',
    tests_name="updated test name",
    tests_description="Updated test description",
    test_instructions="Updated instructions",
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.update({
  test_id: 'TEST_ID',
  tests_name: "updated test name",
  tests_description: "Updated test description",
  test_instructions: "Updated instructions",
  tests_alloted_time_demo_mode: "01:30:00",
  tests_alloted_time_test_mode: "02:30:00"
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:



{
    "message": "Test updated successfully",
    "data": {
        "id": 1234,
        "tests_name": "updated test name",
        "tests_description": "Updated test description",
        "test_instructions": "Updated instructions"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/tests/TEST_ID

Parameters

Parameter Type Description
tests_name string The updated name/title of the test
tests_description string The updated description of the test
test_instructions string The updated instructions for the test
tests_alloted_time_demo_mode string Updated allotted time in demo mode (HH:MM:SS)
tests_alloted_time_test_mode string Updated allotted time in test mode (HH:MM:SS)

Delete test

Delete a test by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/tests/TEST_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.delete(test_id: 'TEST_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.delete(test_id='TEST_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.delete({ test_id: 'TEST_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Test deleted successfully",
    "data": {
        "id": 1234
    }

}

HTTP Request

https://lms.braincert.com/api/v1/tests/TEST_ID

Publish Test

Publish a test by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/tests/publish/TEST_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.publish(test_id: 'TEST_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.publish(test_id='TEST_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.publish({ test_id: 'TEST_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Test published successfully",
    "data": {
        "id": 1234,
        "status": "Published"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/tests/publish/TEST_ID

Unpublish Test

Unpublish test by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/tests/unpublish/TEST_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.unpublish(test_id: 'TEST_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.unpublish(test_id='TEST_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.unpublish({ test_id: 'TEST_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Test unpublished successfully",
    "data": {
        "id": 1234,
        "status": "Unpublished"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/tests/unpublish/TEST_ID

Remove Test From Catalog

Remove the test from catalog by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/tests/removeFromCatalog/TEST_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.tests.remove_from_catalog(test_id: 'TEST_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.tests.remove_from_catalog(test_id='TEST_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.tests.removeFromCatalog({ test_id: 'TEST_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Test removed from catalog successfully",
    "data": {
        "id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/tests/removeFromCatalog/TEST_ID

Product

Get all products

Get all the products from the LMS using the following code example:

curl GET 'https://lms.braincert.org/api/v1/products/list' \
-h 'Authorization: API_KEY' \
-h 'x-domain-id: DOMAIN_ID'
require 'net/http'
require 'uri'

response = Net::HTTP.get_response(
  URI('https://lms.braincert.org/api/v1/products/list'),
  { 'Authorization' => 'API_KEY', 'x-domain-id' => 'DOMAIN_ID' }
)

puts response.body
import requests
print(requests.get(
    'https://lms.braincert.org/api/v1/products/list',
    headers={'Authorization': 'API_KEY', 'x-domain-id': 'DOMAIN_ID'}
).text)
import fetch from 'node-fetch';
fetch('https://lms.braincert.org/api/v1/products/list', {
    method: 'GET',
    headers: { 'Authorization': 'API_KEY', 'x-domain-id': 'DOMAIN_ID' }
})
.then(res => res.text())
.then(console.log)

The above command returns JSON structured like this:

{
    "message": "Products retrieved successfully",
    "data": [
        {
            "id": 123,
            "name": "test",
            "type": "type",
            "sku": "0",
            "price": 0,
            "status": "status"
        }
    ]
}

HTTP Request

https://lms.braincert.org/api/v1/products/list

Get Product By ID

Get a products by ID from the LMS using the following code example:

curl GET 'https://lms.braincert.org/api/v1/products/getproduct/123' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'net/http'
uri = URI('https://lms.braincert.org/api/v1/products/getproduct/123')
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  http.get(uri, { 'Authorization' => 'API_KEY',
                  'x-domain-id'  => 'DOMAIN_ID' })
end
puts res.body
import requests
print(requests.get(
    'https://lms.braincert.org/api/v1/products/getproduct/123',
    headers={'Authorization': 'API_KEY',
             'x-domain-id': 'DOMAIN_ID'}
).text)
import fetch from 'node-fetch';
fetch('https://lms.braincert.org/api/v1/products/getproduct/123', {
    method: 'GET',
    headers: { 'Authorization': 'API_KEY',
               'x-domain-id': 'DOMAIN_ID' }
})
.then(r => r.text())
.then(console.log);

The above command returns JSON structured like this:

{
    "message": "Product retrieved successfully",
    "data": {
        "id": 123,
        "name": "name",
        "type": "type",
        "sku": "0",
        "price": 0,
        "status": "status"
    }
}

HTTP Request

https://lms.braincert.org/api/v1/products/getproduct/123

Create Product

create a products by using the following code example:

curl -X POST 'https://lms.braincert.org/api/v1/products/createProduct' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
  -d {'name=name Test Product 30','price=0','product_type=0','sku 0','is_track_stock=0'}
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.products.create(
  name: "name",
  price: 0,
  product_type: 0,
  sku: 0,
  is_track_stock: 0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.products.create(
    name="name",
    price=0,
    product_type=0,
    sku=0,
    is_track_stock=0
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.products.create({
  name: "name",
  price: 0,
  product_type: 0,
  sku: 0,
  is_track_stock: 0
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Product created successfully",
    "data": {
        "id": 123,
        "name": "Postman Test Product 3",
        "price": 0,
        "product_type": 0,
        "sku": "0",
        "is_track_stock": 0,
        "lms_domain_id": 0,
        "added": "2025-08-14T07:27:13.542Z"
    }
}

HTTP request

https://lms.braincert.org/api/v1/products/createProduct

Parameters

Parameter Type Description
name string The name of the product
price number The price of the product
product_type integer The type/category identifier of the product
sku string The stock keeping unit (SKU) code
is_track_stock integer Set to 1 if stock tracking is enabled, 0 otherwise

Delete Product

delete a products by using the following code example:

curl -X DELETE 'https://lms.braincert.org/api/v1/products/delete/123' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.products.delete(product_id: 123)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.products.delete(product_id=123)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.products.delete({ product_id: 123 })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Product deleted successfully",
    "data": {
        "id": 123
    }
}

HTTP request

https://lms.braincert.org/api/v1/products/delete/123

Publish Product

Publish a products by using the following code example:

curl -X POST 'https://lms.braincert.org/api/v1/products/123/publish' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.products.publish(
  product_id=123,
    name="name",
    price=0,
    product_type=0,
    sku="0",
    is_track_stock=0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.products.publish(
    product_id=123,
    name="name",
    price=0,
    product_type=1,
    sku="0",
    is_track_stock=1
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.products.publish({
  product_id: 123,
  name: "name",
  price: 0,
  product_type: 0,
  sku: "0",
  is_track_stock: 0
})
.then(res => console.log(res))
.catch(err => console.error(err));
{
    "message": "Product status updated successfully",
    "data": {
        "id": 123,
        "status": "status"
    }
}

HTTP Request

https://lms.braincert.org/api/v1/products/123/publish

Unpublish Product

Publish a products by using the following code example:

curl -X POST 'https://lms.braincert.org/api/v1/products/123/unpublish' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.products.unpublish(product_id: 123)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.products.unpublish(product_id=123)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.products.unpublish({ product_id: 123 })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Product status updated successfully",
    "data": {
        "id": 123,
        "status": "Not Published"
    }
}

HTTP Request

https://lms.braincert.org/api/v1/products/123/unpublish

Update product

Update products by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/products/update/PRODUCT_ID’ \
  -H 'authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{
    "name": "name",
    "description": "Description"
  }'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/products/update/PRODUCT_ID")
r=Net::HTTP::Put.new(u,{"authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={name:"name",description:"Description",price:1,category_id:1}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.put("https://lms.braincert.com/api/v1/products/update/PRODUCT_ID",
  headers={"authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  json={"name":"name","description":"Description","price":1,"category_id":1})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/update/PRODUCT_ID",{
  method:"PUT",
  headers:{authorization:"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({name:"name",description:"Description",price:1,category_id:1})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:

{
    "message": "Product updated successfully",
    "data": {
        "id": 123,
        "name": "name",
        "description": "Description"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/products/update/PRODUCT_ID

Parameters

Parameter Type Description
name string The name of the product
description string The product description
price number The price of the product
category_id integer The identifier of the category

Get all product categories

Get all product categories by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/products/update/PRODUCT_ID’ \
  -H 'authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{
    "name": "name",
    "description": "Description",
    "price": 1,
    "category_id": 1
  }'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/products/update/PRODUCT_ID")
r=Net::HTTP::Put.new(u,{"authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={name:"name",description:"Description",price:1,category_id:1}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.put("https://lms.braincert.com/api/v1/products/update/PRODUCT_ID",
  headers={"authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  json={"name":"name","description":"Description","price":1,"category_id":1})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/update/PRODUCT_ID",{
  method:"PUT",
  headers:{authorization:"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({name:"name",description:"Description",price:1,category_id:1})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Product categories retrieved successfully",
    "data": [
        {
            "id": 123,
            "name": "name",
            "status": ""
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/products/update/PRODUCT_ID

Parameters

Parameter Type Description
name string The name of the category

Create product Category

Create product category by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/products/createProductCategory' \
  -H 'Authorization: R90hHeCc88HSOLA8jzlnvJRA0s7h8lXRHzfUeZ9d' \
  -H 'Content-Type: application/json' \
  -H 'x-domain-id: 14278' \
  -d '{
    "name": "name"
  }'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/products/createProductCategory")
r=Net::HTTP::Post.new(u,{"Authorization"=>"R90MHeCc88HSOLA8jzInvJRA0s7h81XRHzfUeZ9d","Content-Type"=>"application/json","x-domain-id"=>"14278"})
r.body={name:"Pro test 1"}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.post("https://lms.braincert.com/api/v1/products/createProductCategory",
  headers={"Authorization":"R90MHeCc88HSOLA8jzInvJRA0s7h81XRHzfUeZ9d","Content-Type":"application/json","x-domain-id":"14278"},
  json={"name":"Pro test 1"})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/createProductCategory",{
  method:"POST",
  headers:{"Authorization":"R90MHeCc88HSOLA8jzInvJRA0s7h81XRHzfUeZ9d","Content-Type":"application/json","x-domain-id":"14278"},
  body:JSON.stringify({name:"Pro test 1"})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Product category created successfully",
    "data": {
        "id": 123,
        "name": "Pro test 1",
        "lms_domain_id": 1234,
        "is_status": 0,
        "user_id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/products/createProductCategory

Parameters

Parameter Type Description
name string The name of the category

Update product category

Update product category by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/products/product-categories/PRODUCT CATEGORYID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{
    "name": "Pro test 1 Updated"
  }'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORYID")
r=Net::HTTP::Put.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={name:"Pro test 1 Updated"}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.put("https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORYID",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  json={"name":"Pro test 1 Updated"})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORYID",{
  method:"PUT",
  headers:{"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({name:"Pro test 1 Updated"})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Product category updated successfully",
    "data": {
        "id": 123,
        "name": "Pro test 1 Updated",
        "lms_domain_id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORYID

Parameters

Parameter Type Description
name string The updated name of the category

Delete product category

Delete product category by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORY_ID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'net/http'
u=URI("https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORY_ID")
r=Net::HTTP::Delete.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID"})
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.delete("https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORY_ID",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORY_ID",{
  method:"DELETE",
  headers:{"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"}
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Product category deleted successfully",
    "data": {
        "id": 123
    }
}

HTTP Request

https://lms.braincert.com/api/v1/products/product-categories/PRODUCT_CATEGORY_ID

Update product price

Update product price by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/products/PRODUCT_ID/price' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{"price": 1}'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/products/PRODUCT_ID/price")
r=Net::HTTP::Put.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={price:1}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.put("https://lms.braincert.com/api/v1/products/PRODUCT_ID/price",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  json={"price":1})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/PRODUCT_ID/price",{
  method:"PUT",
  headers:{"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({price:1})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Product price updated successfully",
    "data": {
        "id": 123,
        "price": "1"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/products/PRODUCT_ID/price

Parameters

Parameter Type Description
price number The price of the product/item

Update product shipping charges

Update product shipping charges by using the following code example:

curl -X PUT 'https://lms.braincert.com/api/v1/products/PRODUCT_ID/shipping-charge' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d{“shipping_charge"=150}’
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/products/PRODUCT_ID/shipping-charge")
r=Net::HTTP::Put.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={shipping_charge:150}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.put("https://lms.braincert.com/api/v1/products/PRODUCT_ID/shipping-charge",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  json={"shipping_charge":150})
print(r.text)
fetch("https://lms.braincert.com/api/v1/products/PRODUCT_ID/shipping-charge",{
  method:"PUT",
  headers:{"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({shipping_charge:150})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Product shipping charge updated successfully",
    "data": {
        "id": 123,
        "shipping_charge": "123"
    }
}

HTTP Request

https://lms.braincert.com/api/v1/products/PRODUCT_ID/shipping-charge

Parameters

Parameter Type Description
shipping_charge number The shipping cost for the product

Shopping cart

Add Course Pricing

Add course pricing by using the following code example:

 curl -X POST 'https://lms.braincert.com/api/v1/shoppingCart/courses/addpricing' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
  -d '{"course_id": 1234, "scheme_price": 0, "scheme_days":0}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.courses.add_pricing(
  course_id=1234,
    scheme_price=0,
    scheme_days=0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.courses.add_pricing(
    course_id=1234,
    scheme_price=0,
    scheme_days=0
)

const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.courses.addPricing({
  course_id: 1234,
  scheme_price: 0,
  scheme_days: 0
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

  {
    "message": "Course pricing added successfully",
    "data": {
        "id": 1234,
        "course_id": 1234,
        "scheme_price": 0,
        "scheme_days": 0
    }
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/courses/addpricing

Parameters

Parameter Type Description
course_id integer The unique identifier of the course
scheme_price number The price set for this pricing scheme
scheme_days integer Number of days the course access is valid (ignored if lifetime = 1)
lifetime integer Set to 1 if the course access is lifetime, 0 otherwise
numbertimes integer Number of times the course can be accessed
subscription integer Set to 1 if this pricing is for a subscription-based model, 0 otherwise

Add Test Pricing

Add test pricing by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/shoppingCart/tests/addpricing' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{"test_id": 34264, "scheme_price": 60, "scheme_days": 2, "lifetime": 0, "numbertimes": 1, "subscription": 1}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.tests.add_pricing(
    test_id=1234,
    scheme_price=0,
    scheme_days=0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.tests.add_pricing(
    test_id=1234,
    scheme_price=0,
    scheme_days=0,
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.tests.addPricing({
  test_id: 1234,
  scheme_price: 0,
  scheme_days: 0
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Test pricing added successfully",
    "data": {
        "id": 123,
        "test_id": 1234,
        "scheme_price": 0,
        "scheme_days": 0
    }
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/tests/addpricing

Parameters

Parameter Type Description
test_id number The unique identifier of the test
scheme_price number The price set for this pricing scheme
scheme_days number Number of days the test is accessible (ignored if lifetime = 1)
lifetime number Set to 1 if test access is lifetime, 0 otherwise
numbertimes number Number of times the test can be attempted
subscription number Set to 1 if this pricing is for a subscription-based model, 0 otherwise

Add Class Pricing

Add class pricing by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/shoppingCart/live-classes/addpricing' \
  -H 'Authorization: API’_KEY \
  -H 'x-domain-id: DOMAIN’_ID \
  -d '{"class_id": 1234, "scheme_price": 0, "scheme_days": 0 }'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.live_classes.add_pricing(
    class_id=1234,
    scheme_price=0,
    scheme_days=0,
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.live_classes.add_pricing(
    class_id=1234,
    scheme_price=0,
    scheme_days=0,
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.liveClasses.addPricing({
  class_id: 1234,
  scheme_price: 0,
  scheme_days: 0,
})
.then(res => console.log(res))
.catch(err => console.error(err));

  {
    "message": "Live class pricing added successfully",
    "data": {
        "id": 1234,
        "class_id": 1234,
        "scheme_price": 0,
        "scheme_days": 0
    }
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/live-classes/addpricing

Parameters

Parameter Type Description
class_id number The unique identifier of the live class
scheme_price number The price assigned to this pricing scheme
scheme_days number Number of days the class is accessible (ignored if lifetime = 1)
lifetime number Set to 1 for lifetime access, 0 for time-limited access
numbertimes number Number of times the class can be attended or accessed
subscription number Set to 1 if this pricing is subscription-based, 0 otherwise

List Course Pricing

Get course pricing list from the LMS by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/shoppingCart/courses/pricing/COURSE_ID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.courses.get_pricing(course_id: 'COURSE_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.courses.get_pricing(course_id='COURSE_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.courses.getPricing({ course_id: 'COURSE_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Course pricing listed successfully",
    "data": [
        {
            "id": 1234,
            "course_id": 1234,
            "scheme_price": 0,
            "scheme_days": 0,
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/courses/pricing/COURSE_ID

List test pricing

Get test pricing list from the LMS by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/shoppingCart/tests/pricing/TEST’_ID \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.tests.get_pricing(test_id: 'TEST_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.tests.get_pricing(test_id='TEST_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.tests.getPricing({ test_id: 'TEST_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Test pricing listed successfully",
    "data": [
        {
            "id": 1234,
            "test_id": 0,
            "scheme_price": 0,
            "scheme_days": 0
        }
    ]
}

HTTP request

https://lms.braincert.com/api/v1/shoppingCart/tests/pricing/TEST’_ID

Parameters

Parameter Type Description
test_id number The unique identifier of the test
scheme_price number The price set for this pricing scheme
scheme_days number Number of days the test is accessible (ignored if lifetime = 1)
lifetime number Set to 1 if test access is lifetime, 0 otherwise
numbertimes number Number of times the test can be attempted
subscription number Set to 1 if this pricing is for a subscription-based model, 0 otherwise

List Live Class Pricing

Get live class pricing list from the LMS by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/shoppingCart/live-classes/pricing/CLASS_ID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.live_classes.get_pricing(class_id: 'CLASS_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.live_classes.get_pricing(class_id='CLASS_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.liveClasses.getPricing({ class_id: 'CLASS_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


 {
    "message": "Live class pricing listed successfully",
    "data": [
        {
            "id": 1234,
            "class_id": 1234,
            "scheme_price": 0,
            "scheme_days": 0
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/live-classes/pricing/CLASS_ID

Remove Course Pricing

Remove course pricing by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/shoppingCart/courses/deletepricing' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{"course_id": 1234, "price_scheme_id": 1234}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.courses.delete_pricing(
  course_id: 1234,
  price_scheme_id: 1234
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.courses.delete_pricing(
    course_id=1234,
    price_scheme_id=1234
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.courses.deletePricing({
  course_id: 1234,
  price_scheme_id: 1234
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Course pricing removed from cart successfully",
    "data": {
        "course_id": 1234,
        "price_scheme_id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/courses/deletepricing

Parameters

Parameter Type Description
course_id number The unique identifier of the course
price_scheme_id number The ID of the pricing scheme to be deleted or referenced

Remove Test Pricing

Remove test pricing by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/shoppingCart/tests/deletepricing' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{"test_id": 1234, "price_scheme_id": 1234}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.tests.delete_pricing(
  test_id: 1234,
  price_scheme_id: 1234
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.tests.delete_pricing(
    test_id=1234,
    price_scheme_id=1234
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.tests.deletePricing({
  test_id: 1234,
  price_scheme_id: 1234
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:


 {
    "message": "Test pricing removed from cart successfully",
    "data": {
        "test_id": 1234,
        "price_scheme_id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/tests/deletepricing

Parameters

Parameter Type Description
test_id number The unique identifier of the test
price_scheme_id number The ID of the pricing scheme to be deleted or updated

Remove Live Class Pricing

Remove live class pricing by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/shoppingCart/live-classes/deletepricing' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{"live_class_id": 1234, "price_scheme_id": 1234}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.shopping_cart.live_classes.delete_pricing(
  live_class_id: 1234,
  price_scheme_id: 1234
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.shopping_cart.live_classes.delete_pricing(
    live_class_id=1234,
    price_scheme_id=1234
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.shoppingCart.liveClasses.deletePricing({
  live_class_id: 1234,
  price_scheme_id: 1234
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Live class pricing removed from cart successfully",
    "data": {
        "live_class_id": 1234,
        "price_scheme_id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/shoppingCart/live-classes/deletepricing

Parameters

Parameter Type Description
live_class_id number The unique identifier of the live class
price_scheme_id number The ID of the pricing scheme to be deleted or updated

Discounts

List all global discounts

List all global discounts by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/discounts/globaldiscounts/list' \
  -H 'Authorization:API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.global_discounts.list
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.global_discounts.list()
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.globalDiscounts.list()
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


 {
    "message": "Global discounts listed successfully",
    "data": [
        {
            "id": 123,
            "code": ""
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/globaldiscounts/list

List course discounts

List course discounts by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/discounts/courses/COURSE’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.courses.get(course_id: 'COURSE_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.courses.get(course_id='COURSE_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.courses.get({ course_id: 'COURSE_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


 {
    "message": "Course discounts listed successfully",
    "data": [
        {
            "id": 1234,
            "code": ""
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/courses/COURSE

List test discounts

List test discounts by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/discounts/tests/TEST_ID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.tests.get(test_id: 'TEST_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.tests.get(test_id='TEST_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.tests.get({ test_id: 'TEST_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:



 {
    "message": "Test discounts listed successfully",
    "data": [
        {
            "id": 1234,
            "code": ""
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/tests/TEST_ID

List live class discounts

List live class discounts by using the following code example:

curl -X GET 'https://lms.braincert.com/api/v1/discounts/live-classes/LIVE_CLASS_ID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.live_classes.get(live_class_id: 'LIVE_CLASS_ID')
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.live_classes.get(live_class_id='LIVE_CLASS_ID')
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.liveClasses.get({ live_class_id: 'LIVE_CLASS_ID' })
  .then(res => console.log(res))
  .catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Live class discounts listed successfully",
    "data": [
        {
            "id": 123,
            "code": ""
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/live-classes/LIVE_CLASS_ID

Add course discount

Add course discounts by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/discounts/addCourseDiscount' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{(
    "course_id": 1234,
    "discount_code": "Discount",
    "is_use_discount_code": 0
   ) }'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.add_course_discount(
  course_id: 1234,
  discount_code: "Discount",
  is_use_discount_code: 0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.add_course_discount(
    course_id=1234,
    discount_code="Discount",
    is_use_discount_code=0
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.addCourseDiscount({
  course_id: 1234,
  discount_code: "Discount",
  is_use_discount_code: 0
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

   {
    "message": "Course discount added successfully",
    "data": {
        "id": 1234,
        "course_id": 1234,
        "discount_code": "Discount",
        "is_use_discount_code": 0
    }
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/addCourseDiscount

Parameters

Parameter Type Description
course_id number Unique ID of the course to which the discount applies
discount_code string Optional discount code for promotional use
is_use_discount_code number Set to 1 to require code usage; 0 to apply discount automatically
discount_limit number Maximum number of times the discount can be used (ignored if is_no_limit = 1)
discount_type string Type of discount: "percentage" or "flat"

Add test discount

Add test discounts by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/discounts/addTestDiscount' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{(
    "test_id": 1234,
    "discount_code": "",
    "is_use_discount_code": 0
  )}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.add_test_discount(
  test_id: 1234,
  discount_code: "",
  is_use_discount_code: 0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.add_test_discount(
    test_id=1234,
    discount_code="",
    is_use_discount_code=0
)

const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.addTestDiscount({
  test_id: 1234,
  discount_code: "",
  is_use_discount_code: 0
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:


{
    "message": "Test discount added successfully",
    "data": {
        "id": 1234,
        "test_id": 1234,
        "discount_code": "",
        "is_use_discount_code": 0
    }
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/addTestDiscount

Parameters

Parameter Type Description
test_id number Unique ID of the test to which the discount applies
discount_code string Optional discount code to apply the discount
is_use_discount_code number 1 if a user must enter the code; 0 if discount applies automatically
discount_limit number Maximum number of times the discount can be used
discount_type string Discount type: "percentage" or "flat"
special_price number Discount value (e.g., 40 for 40%)
is_no_limit number 1 for unlimited use; 0 to enforce discount_limit
start_date string Discount validity start date in YYYY-MM-DD format
end_date string Discount validity end date in YYYY-MM-DD format

Add live class discount

Add live class discounts by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/discounts/addLiveClassDiscount' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{(
    "class_id": "",
    "discount_code": "",
    "is_use_discount_code": 0
  )}'
require 'braincert'

api = BrainCert::APIClient.authorize!('API_KEY', domain_id: 'DOMAIN_ID')

api.discounts.add_live_class_discount(
  class_id: "",
  discount_code: "",
  is_use_discount_code: 0
)
from braincert import APIClient

api = APIClient.authorize('API_KEY', domain_id='DOMAIN_ID')

api.discounts.add_live_class_discount(
    class_id="",
    discount_code="",
    is_use_discount_code=0
)
const BrainCert = require('braincert');

const api = BrainCert.APIClient.authorize('API_KEY', { domain_id: 'DOMAIN_ID' });

api.discounts.addLiveClassDiscount({
  class_id: "",
  discount_code: "",
  is_use_discount_code: 0,
})
.then(res => console.log(res))
.catch(err => console.error(err));

The above command returns JSON structured like this:

{
    "message": "Live class discount added successfully",
    "data": {
        "id": 567,
        "class_id": 1234,
        "discount_code": "DC10",
        "is_use_discount_code" : 0
    }
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/addLiveClassDiscount

Parameters

Parameter Type Description
class_id number Unique ID of the live class to which the discount applies
discount_code string Optional discount code to apply the discount
is_use_discount_code number 1 if a user must enter the code; 0 if discount applies automatically
discount_limit number Maximum number of times the discount can be used
discount_type string Discount type: "percentage" or "flat"
is_no_limit number 1 for unlimited use; 0 to enforce discount_limit
special_price number Discount value (e.g., 45 for 45%)
start_date string Discount validity start date in YYYY-MM-DD format
end_date string Discount validity end date in YYYY-MM-DD format
is_never_expire number 1 if the discount never expires; 0 if end_date is enforced

Remove course discount

Remove course discounts by using the following code example:

curl --location --request DELETE 'https://lms.braincert.com/api/v1/discounts/removeCourseDiscount/COURSE_ID’ \
--header 'Authorization: API_KEY’ \
--header 'x-domain-id: DOMAIN_ID’ \
--data '{"discount_id": 1234}'
require 'net/http'; require 'json'; uri=URI("https://lms.braincert.com/api/v1/discounts/removeCourseDiscount/COURSE_ID")
res=Net::HTTP.start(uri.host,uri.port,use_ssl:true){|h|h.request(Net::HTTP::Delete.new(uri,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"},'{"discount_id":1234}'))}
puts res.body
import requests
r=requests.delete("https://lms.braincert.com/api/v1/discounts/removeCourseDiscount/COURSE_ID",
                  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"},
                  json={"discount_id":1234})
print(r.text)
const fetch = require("node-fetch");

const url = "https://lms.braincert.com/api/v1/discounts/removeCourseDiscount/COURSE_ID";

const options = {
  method: "DELETE",
  headers: {
    "Authorization": "API_KEY",
    "x-domain-id": "DOMAIN_ID",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ discount_id: 1234 })
};

fetch(url, options)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.error("Error:", error));

The above command returns JSON structured like this:


{
    "message": "Course discount removed successfully",
    "data": {
        "id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/removeCourseDiscount/COURSE_ID’

Parameters

Parameter Type Description
discount_id number The unique identifier of the discount to be removed

Remove test discount

Remove test discounts by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/discounts/removeTestDiscount/TEST_ID’ \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’ \
  -d '{"discount_id": 1234}'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/discounts/removeTestDiscount/TEST_ID")
r=Net::HTTP::Delete.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={discount_id:1234}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.delete("https://lms.braincert.com/api/v1/discounts/removeTestDiscount/TEST_ID",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"},
  json={"discount_id":1234})
print(r.text)
fetch("https://lms.braincert.com/api/v1/discounts/removeTestDiscount/TEST_ID",{
  method:"DELETE",
  headers:{Authorization:"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({discount_id:1234})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Test discount removed successfully",
    "data": {
        "id": 1234
    }
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/removeCourseDiscount/COURSE_ID’

Parameters

Parameter Type Description
discount_id number The unique identifier of the discount to remove

Remove live class discount

Remove live class discounts by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
  -d '{"discount_id": 123}'
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID")
r=Net::HTTP::Delete.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={discount_id:123}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.delete("https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"},
  json={"discount_id":123})
print(r.text)
fetch("https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID",{
  method:"DELETE",
  headers:{Authorization:"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({discount_id:123})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


 {
    "message": "Live class discount removed successfully",
    "data": {
        "id": 123
    }
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID

Parameters

Parameter Type Description
discount_id number The unique identifier of the discount to remove

Gamification

Leaderboard

Get Leaderboard by using the following code example:

curl -X DELETE 'https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID' \
  -H 'Authorization: API_KEY' \
  -H 'x-domain-id: DOMAIN_ID' \
require 'net/http';require 'json'
u=URI("https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID")
r=Net::HTTP::Delete.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID","Content-Type"=>"application/json"})
r.body={discount_id:123}.to_json
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.delete("https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"},
  json={"discount_id":123})
print(r.text)
fetch("https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID",{
  method:"DELETE",
  headers:{Authorization:"API_KEY","x-domain-id":"DOMAIN_ID","Content-Type":"application/json"},
  body:JSON.stringify({discount_id:123})
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "Leaderboard retrieved successfully",
    "data": [
        {
            "user_id": 123,
            "name": "nadeem",
            "points": 1,
            "added": 123
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/discounts/removeLiveClassDiscount/CLASS_ID

User points

Get user points by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/gamification/user-points' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’
require 'net/http'
u=URI("https://lms.braincert.com/api/v1/gamification/user-points")
r=Net::HTTP::Post.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID"})
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.post("https://lms.braincert.com/api/v1/gamification/user-points",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"})
print(r.text)
fetch("https://lms.braincert.com/api/v1/gamification/user-points",{
  method:"POST",
  headers:{Authorization:"API_KEY","x-domain-id":"DOMAIN_ID"}
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:


{
    "message": "User points retrieved and badges evaluated",
    "data": {
        "user_id": 1234,
        "gamification_points": 123
    }
}

HTTP Request

https://lms.braincert.com/api/v1/gamification/user-points

User badges

Get user points by using the following code example:

curl -X POST 'https://lms.braincert.com/api/v1/gamification/user-badges' \
  -H 'Authorization: API_KEY’ \
  -H 'x-domain-id: DOMAIN_ID’
require 'net/http'
u=URI("https://lms.braincert.com/api/v1/gamification/user-badges")
r=Net::HTTP::Post.new(u,{"Authorization"=>"API_KEY","x-domain-id"=>"DOMAIN_ID"})
puts Net::HTTP.start(u.host,u.port,use_ssl:true){|h|h.request(r)}.body
import requests
r=requests.post("https://lms.braincert.com/api/v1/gamification/user-badges",
  headers={"Authorization":"API_KEY","x-domain-id":"DOMAIN_ID"})
print(r.text)
fetch("https://lms.braincert.com/api/v1/gamification/user-badges",{
  method:"POST",
  headers:{Authorization:"API_KEY","x-domain-id":"DOMAIN_ID"}
}).then(r=>r.text()).then(console.log).catch(console.error);

The above command returns JSON structured like this:

{
    "message": "User badges retrieved successfully",
    "data": [
        {
            "id": 123,
            "description": "discription",
            "points_required": 1
        }
    ]
}

HTTP Request

https://lms.braincert.com/api/v1/gamification/user-badges

Error Codes

The BrainCert LMS API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key or Domain ID is incorrect.
403 Forbidden -- You do not have permission to access this.
404 Not Found -- The requested resource could not be found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't JSON.
429 Too Many Requests -- You have exceeded the rate limit.
500 Internal Server Error -- We had an issue on our server.
503 Service Unavailable -- We are temporarily offline for maintenance.