Topics: Introduction

Introduction

Introduction

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;
}