AlphaLearn API Documentation


AlphaLearn LMS APIs provide the ability to view course details, user details, batch details, etc. This API is a server side implementation designed around REST. All the REST API calls should be POST HTTPS requests server-side.


Endpoint

https://app.alphalearn.com/webapi/v1

The AlphaLearn API endpoint is pretty straight forward.The base URL is app.alphalearn.com followed by the version number of the API, currently at version 1.


Authorization:

AlphaLearn API provides authorization token which can be passed in the HTTP Authorization Header using ‘Bearer’.


Header

Authorization: Bearer { Athorization Token }


Example:

The example is in PHP.

Example:
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://app.alphalearn.com/webapi/v1/course-list",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer { Authorization Token }",
    "cache-control: no-cache",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Course List


List all courses for a company

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-list 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-list \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
     "data": {
        "course_list": [
            {
                "id": "integer",
                "title": "string",
                "courseCode": "string",
                "thumbnail": "string",
                "companyID": "integer",
                 "description": "string",
                "price_inr": "integer",
                "price_USD": "integer",
                "start_date": "date",
                "end_date": "date",
                "updatedDate": "datetime",
                "department": "string",
                "designation": "string"
            },  
    ],
        "totalCount": "integer",
        "pageSize": "integer"
        "page": "integer",      
   }
}

Course Basic Details


Retrieve a single course basic detail

QueryArguments

courseID integer The course id
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-basic-details 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-basic-details \
  -H 'authorization: Bearer {Authorization Token}' \
  -F courseID={courseID}
Example Response:
200 OK
{
    "success": true,
    "data": 
       {
         "id": "integer",
        "title": "string",
        "courseCode": "string",
        "description": "string",
        "duration": "integer",
        "start_date": "date",
        "end_date": "date",
        "price_INR": "float",
        "price_USD": "float",
        "thumbnail": "string",
        "department": "string",
        "designation": "string",
        "faq": "string",
        "demovideo": "string",
        "features": "string",
        "trainer_displayname": "string",
        "tags": "strings",
        "updatedDate": "datetime"
     }
}

Course Details


Retrieve single course details

QueryArguments

courseID integer The course id
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-all-details 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-all-details \
  -H 'authorization: Bearer {Authorization Token}' \
  -F courseID={courseID}
Example Response:
200 OK
{
    "success": true,
    "data": 
      {
        "id": "integer",
        "title": "string",
        "courseCode": "string",
        "description": "string>",
        "duration": "integer",
        "start_date": "date",
        "end_date": "date",
        "price_INR": "float",
        "price_USD": "float",
        "thumbnail": "string",
        "department": "string",
        "designation": "string",
        "faq": "string",
        "demovideo": "",
        "features": "string",
        "trainer_displayname": "string",
        "tags": "string",
        "updatedDate": "datetime",
        "seo": {
            "title": "string",
            "description": "string",
            "keywords": "string"
        }
     }
}

Course by Ratings


Course list according to ratings

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-by-ratings 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-by-ratings \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data": {
        "popular_courses": [
            {
                "id": "integer",
                "title": "string",
                "courseCode": "string",
                "description": "string",
                "duration": "integer",
                "start_date": "date",
                "end_date": "date",
                "price_INR": "float",
                "price_USD": "float",
                "thumbnail": "string",
                "rates": "integer"
            },
        ],
        "totalCount": "integer",
        "pageSize": "integer",
        "page": "integer"
    }
}

Course by Enrollments


Course list according to enrollmets

QueryArguments

type integer type i.e 1 (for current enrollment) / 2 (for all enrollments)
totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-by-enrollments
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-by-enrollments\
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data":  [
            {
                "id": "integer",
                "title": "string",
                "courseCode": "string",
                "description": "string",
                "duration": "integer",
                "start_date": "date",
                "end_date": "date",
                "price_INR": "float",
                "price_USD": "float",
                "thumbnail": "string",
                "department": "string",
                "designation": "string",
                "enrollmentcount": "string"
            }
        ]
}

Register Trainee


Register as a new trainee

QueryArguments

fname string Fisrtname of the user
lname string Lastname of the user
mobile integer Mobile number of the user
email string Email of the user
Definition:
 POST https://app.alphalearn.com/webapi/v1/signup
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/signup\
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data": {
        "user": {
            "id": "integer",
            "title": "string",
            "fname": "string",
            "lname": "string",
            "mobile": "9664131394",
            "email": "string",
            "password": "string",
            "auth_key": "string",
            "password_reset_token": "string",
            "password_reset_date": "date",
            "rollno": "string",
            "department": "string",
            "designation": "string",
            "grade": "string",
            "state": "integer",
            "companyname": "string",
            "subcompanyID": "integer",
            "companyManagerID": "integer",
            "workphone": "string",
            "address": "string",
            "city": "string",
            "zip": "string",
            "country": "string",
            "companyID": "integer",
            "roleID": "integer",
            "createdBy": "integer",
            "createdDate": "date",
            "updatedDate": "date",
            "status": "integer",
            "gstno": "string",
            "sessionID": "string"
        },
    }
}

Enroll Trainee


Enroll a single trainee to a course.

QueryArguments

userID integer The user id
courseID integer The course id
Definition:
 POST https://app.alphalearn.com/webapi/v1/enroll-trainee
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/enroll-trainee\
  -H 'authorization: Bearer {Authorization Token}' \
  -F {
       userID={userID},
       courseID={courseID}
     }
Example Response:
200 OK
{
    "success": true,
    "data": {
        "success": "Trainee enrolled"
    }
}

Trainee List


List trainees in a company

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/trainee-list 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/trainee-list \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data": {
        "user_list": [
            {
                "id": "integer",
                "rollno": "integer",
                "title": "string",
                "fname": "string",
                "lname": "string",
                "email": "string"
            },
      ],
        "totalCount": "integer",
        "page": "integer",
        "pageSize": "integer"
  }
}

Trainee Profile


Retrieve a single trainee basic details

QueryArguments

userID integer The user id
totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/trainee-profile
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/trainee-profile\
  -H 'authorization: Bearer {Authorization Token}' \
  -F userID={userID}
Example Response:
200 OK
{
   "success": true,
    "data": [
        {
        "id": "integer",
        "fname": "string",
        "lname": "string",
        "email": "string",
        "rollno": "intger",
        "grade": "string",
        "companyname": "string",
        "workphone": "intger",
        "address": "string",
        "timezone": "string",
        "department": "string",
        "city": "string",
        "states": "string",
        "country": "string",
        "zip": "string",
        "zone": "string"
        },   
    ]
}

Trainee Details


Course list for a particular user who is logged in

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/trainee-details 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/trainee-details \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data": {
        "ongoing": [
            {
                "title": "string",
                "courseCode": "string",
                "completedPercent": "integer",
                "startDate": "date",
                "endDate": "date",
                "isachived": "integer",
                "achivedDate": "datetime"
            }
        ],
        "expired": [
            {
                "title": "string",
                "courseCode": "string",
                "completedPercent": "integer",
                "startDate": "date",
                "endDate": "date",
                "isachived": "integer",
                "achivedDate": "datetime"
            }
        ],
        "complted": [
            {
                "title": "string",
                "courseCode": "string",
                "completedPercent": "string",
                "startDate": "date",
                "endDate": "date",
                "isachived": "integer",
                "achivedDate": "datetime"
            }
        ],
        "learningpaths": {
            "learningpath_name": [
                {
                    "id": "integer",
                    "name": "string",
                    "code": "string",
                    "title": "string",
                    "courseCode": "string",
                    "completedPercent": "integer",
                    "startDate": "date",
                    "endDate": "date",
                    "isachived": "integer",
                    "achivedDate": "datetime"
                }
            ]
        },
        "exam": [
            {
                "examTitle": "string",
                "duration": "integer",
                "total_questions": "integer",
                "total_marks": "integer",
                "passingMarks": "integer",
                "startDate": "date",
                "endDate": "date",
                "attemptDate": "datetime",
                "submitDate": "datetime",
                "scheduledon": "datetime",
                "status": "integer"
            }
        ]
    }
}

Update Trainee Profile


Update a single trainee basic details

QueryArguments

userID integer The user id
fname string Firstname of the user
lname string Lastname of the user
mobile number Contact number of the user
city integer City of the user
Country integer Country of the user
state integer State of the user
status integer Status of the user
Definition:
 POST https://app.alphalearn.com/webapi/v1/user-update?userid=
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/user-update?userid= \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data": {
        "success": "User details Updated."
    }
}

Delete Trainee


Delete a trainee user

QueryArguments

userID integer The user id
Definition:
 POST https://app.alphalearn.com/webapi/v1/delete-trainee
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/delete-trainee \
  -H 'authorization: Bearer {Authorization Token}' \
  -F userID={userID}
Example Response:
200 OK
{
    "success": true,
    "data": {
        "success": "Trainee deleted."
    }
}

Disable Trainee


Disable a trainee.

QueryArguments

userID integer The user id
Definition:
 POSThttps://app.alphalearn.com/webapi/v1/disable-trainee
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/disable-trainee\
  -H 'authorization: Bearer {Authorization Token}' \
  -F userID={userID}
Example Response:
200 OK
{
    "success": true,
    "data": {
        "success": "Trainee disabled."
    }
}

Unenroll Trainee


Un enroll a trainee from a

QueryArguments

userenrollIDinteger The user enrollment id
Definition:
 POST https://app.alphalearn.com/webapi/v1/unenroll-trainee
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/unenroll-trainee \
  -H 'authorization: Bearer {Authorization Token}' \
  -F userID={userID}
Example Response:
200 OK
{
    "success": true,
    "data": {
        "success": "Trainee unenrolled."
    }
}/pre>

Batch List


List all batches for a company

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/batch-list 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/batch-list \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
 "success": true,
    "data": {
        "batch_list": [
            {
               "id": "integer",
               "name": "string",
               "description": "string"
            }, 
        ],
        "totalCount": "integer",
        "pageSize": "integer",
        "page": "integer"
        
    }
}

Courses in Batch


List all courses in a batch

Query Arguments

batchID integer The batch id
totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/courses-in-batch 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/courses-in-batch \
  -H 'authorization: Bearer {Authorization Token}' \
  -F batchID={batchID}
Example Response:
200 OK
{
    "success": true,
    "data": {
        "course_batch": [
            {
               "title": "string",
               "startDate": "date",
               "endDate": "date"
            }
        ],
        "totalCount": "integer",
        "pageSize": "integer",
        "page": "integer",
    }
}

Trainees in Batch


List all trainees in a batch

Query Arguments

batchID integer The batch id
totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/trainees-in-batch
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/trainees-in-batch \
  -H 'authorization: Bearer {Authorization Token}' \
  -F batchID={batchID}
Example Response:
200 OK
{
 "success": true,
    "data": {
        "user_batch": [
            {
               "id": "integer",
               "fname": "string",
               "lname": "string",
               "email": "string",
               "rollno": "string"
            }, 
        ],
        "totalCount": "integer",
        "pageSize": "integer",
        "page": "integer"
    }
}

Add Trainee to Batch


Add a single trainee to batch

QueryArguments

userID string The user id
batchID string Batch description
Definition:
 POST https://app.alphalearn.com/webapi/v1/add-trainee-to-batch
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/add-trainee-to-batch\
  -H 'authorization: Bearer {Authorization Token}' \
  -F {
      userID={userID},
      batchID={batchID}
    }

Example Response:
200 OK
{
    "success": true,
    "data": {
        "success": "User added to batch"
    }
}

Exam List


List all exams for a company

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/exam-list 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/exam-list \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
 "success": true,
    "data": {
        "examlist": [
            {
               "id": "integer",
               "examTitle": "string",
            }, 
        ],
        "totalCount": "integer",
        "pageSize": "integer",
        "page": "integer"
        
    }
}

Exam Details


Retrieve a single exam basic detail

QueryArguments

examID integer The exam id
Definition:
 POST https://app.alphalearn.com/webapi/v1/exam-details 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/exam-details \
  -H 'authorization: Bearer {Authorization Token}' \
  -F examID={examID}
Example Response:
200 OK
{
    "success": true,
    "data": [
       {
        "id": "integer",
        "courseID": "integer",
        "subjectID": "integer",
        "examTitle": "string",
        "period": "integer",
        "duration": "integer",
        "tquestion": "integer",
        "tmarks": "integer",
        "beoc": "integer",
        "startDate": "date",
        "passingMarks": "integer",
        "sequenceRandom": "integer",
        "examtypeMarks": "integer",
        "isAutomated": "integer",
        "status": "integer",
        "showResult": "integer",
        "noOfAttempts": "integer",
        "isreschbytrainee": "integer",
        "isprogresshundred": "integer",
        "appearAfter": "integer",
        "createdDate": "date",
        "updatedDate": "date",
        "reminder1": "integer",
        "reminder2": "integer",
        "eventrestriction": "integer",
        "eventcount": "integer"
     }
  ]
}

Announcements List


Retrieve announcement list

QueryArguments

pageSize Number of returned records in current api call
Definition:
 POST https://app.alphalearn.com/webapi/v1/announcement-list
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/announcement-list\
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK

    {
    "success": true,
    "data":{
        "announcement": [
           {
                "id": "integer",
                "title": "New  ISO Course Launched",
                "description": "Course ISO 22000 Food Safety Management 
                                System has been launched.Enrollment will 
                                begin from 1st June 2019.",
                "createdDate": "date",
                "createdBy": "integer",
                "updatedDate": "date",
                "updatedBy": "integer",
                "status": "integer"
          },
      ]
   }
}

FAQ list


Retrieve faq list

QueryArguments

pageSize Number of returned records in current api call
Definition:
 POST https://app.alphalearn.com/webapi/v1/faq-list
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/faq-list \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK

    {
    "success": true,
    "data":{
        "faq": [
           {
             "id": "integer",
             "question": "string",
             "status": "integer",
             "createdDate": "date",
             "updatedDate": "date",
             "createdBy": "integer",
             "updatedBy": "integer"
          },
      ]
   }
}

Blog List


List all blogs for a company. The list consist of 6 latest blogs and 6 old blogs.

QueryArguments

No Query Arguments
Definition:
 POST https://app.alphalearn.com/webapi/v1/blog-list
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/blog-list\
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
    "success": true,
    "data": {
        "latest": [
            {
                "id": "integer",
                "title": "string",
                "description": "string",
                "name": "string",
                "createdDate": "date",
                "image": "string"
            }
        ],
        "old": [
            {
                "id": "integer",
                "title": "string",
                "description": "string",
                "name": "string",
                "createdDate": "date",
                "image": "string"
            }
        ],
    }
}

Blog Details


Retrieve a single blog.

QueryArguments

blogID integer The blog id
totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/blog-details
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/blog-details\
  -H 'authorization: Bearer {Authorization Token}' \
  -F blogID={blogID}
Example Response:
200 OK
{
    "success": true,
    "data": {
                "id": "integer",
                "title": "string",
                "description": "string",
                "name": "string",
                "createdDate": "date",
                "image": "string"
    }
}

Testimonials List


Retrieve latest testimonials list

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/testimonials-list 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/testimonials-list \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK

    {
    "success": true,
    "data":{
       "testimonials": [
         {     
            "id": "integer",
            "description": "string",
            "createdDate": "date",
            "updatedDate": "date",
            "createdBy": "integer",
            "updatedBy": "integer",
            "status": "integer"
        },
     ]
  }
}

Course Categories


List all categories for a company. Courses can be linked to a particular category.

QueryArguments

totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-category 
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-category  \
  -H 'authorization: Bearer {Authorization Token}' \
Example Response:
200 OK
{
 "success": true,
    "data": {
        "examlist": [
            {
               "id": "integer",
               "parent_id": "integer",
               "name": "string"
            }, 
        ],
        "totalCount": "integer",
        "pageSize": "integer",
        "page": "integer"
        
    }
}

Course By Category


Retrieve course list based on single category.

QueryArguments

categoryID integer The category id
totalCount Total number of records
pageSize Number of returned records in current api call
page Current page number of returned records
Definition:
 POST https://app.alphalearn.com/webapi/v1/course-list
Example Request:
 curl -X POST \
  https://app.alphalearn.com/webapi/v1/course-list\
  -H 'authorization: Bearer {Authorization Token}' \
  -F categoryID={categoryID}
Example Response:
200 OK
{
    "success": true,
     "data": {
        "course_list": [
            {
                "id": "integer",
                "title": "string",
                "courseCode": "string",
                "thumbnail": "string",
                 "description": "string",
                "price_inr": "integer",
                "price_USD": "integer",
                "start_date": "date",
                "end_date": "date",
                "updatedDate": "datetime",
                "department": "string",
                "designation": "string"
            },  
    ],
        "totalCount": "integer",
        "pageSize": "integer"
        "page": "integer",      
   }
}