LMS APIs
Introduction
The Edcast LMS API can be consumed by clients for managing
- content
- assignments
- completions
Note: Contents are grouped under the source through which they are created . Assignments & Completions can be created only for those contents that are created through the LMS API. It cannot be used for creating Assignments & Completions for contents imported through any other sources.
Connector Configuration
Connector needs to be configured before pushing the content to LXP platform. This section describes the steps to configure the connector in the LXP
administration portal.
Create The Source
Login into LXP admin portal as Admin of the organization.
Create a Source for the LMS API Integration Source Type under LMS Integrations.
Note:
The host field is not used, but is mandatory. Enter any dummy value.
custom_lms_key & Assignor Name are required only if you plan to capture completions.
Best dimensions for logo & banner
Logo width 180 height 100 with minimal padding
Banner width 1018 height 160
Set up the Assignor
When a Course is started , it can be configured to be displayed as Assigned by a specific user (called the Assignor)
To achieve this, the assignor should be created as a user & selected in the Assignor Name dropdown during source creation
Feature Provider
If enabled as shown below,
The logo will appear in the Featured Providers Carousal on the Discover Tab
& then the user can click on it to view all the content from this source as below
Default Language
The content will be assigned the selected language in the Default Language dropdown when the language is not received in the API request.
If the requirement is that the content is searchable by users of all languages , then it is required that the language is selected as unspecified & no language
is specified in the API request.
Mark As Completed
When enabled , it allows users to click on the Mark as Completed button.
If the API to push the Completion event is going to be consumed, it will be recommended to disable the Mark As Completed button by configuring it at the
source as below.
When disabled,
Configurations
Click on OAuth2 Apps to create clientId for the specific created connector
Add name and select the specific created connector
In above image: After hovering on client id value you will get the client secret
### Credentials & Parameters
Parameter | Value | Description |
---|---|---|
Client Id | To be Procured from the Edcast Org Admin | Used to generate the token |
Client Secret | To be Procured from the Edcast Org Admin | Used to generate the token |
LMS Host | https://lms.edcast.io https://lms-europe.edcast.io https://lms-app-us-prod3.edcast.com https://aws-eu-central1-lms-integration.edcastpreview.com | This is to be used in the URL of the request US EU US Prod 3 Preview |
API Endpoints
Authentication
-
URL
LMS HOST/api/oauth/token -
Method
POST -
Parameters
Parameter | Description | Value |
---|---|---|
Client Id | client_id Procured from the Edcast Org Admin | |
Client Secret | client_secret Procured from the Edcast Org Admin | |
grant_type | client_credentials |
Sample Curl Request
curl --location --request POST 'https://lms-app-us-prod3.edcast.com/api/oauth/token?
client_id=yourcliendidhere
&client_secret=yourclientsecrethere
&grant_type=client_credentials'
- Sample Response
LMS API Authentication API Response
{
"access_token":"AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE",
"token_type":"bearer",
"expires_in":3600
}
The below API endpoints will return HTTP status 202 Accepted when the request is successfully accepted. The processing will be queued & executed as
per available capacity
Creating/Updating Content
-
URL
LMS HOST/api/developer/v2/courses.json -
Method
POST -
Headers
Header Name | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE |
- Body
The body should always contain the entire content metadata when creating / updating the content (not not just the partial metadata that needs updating)
Sample Body (Minimum payload)- request using bare minimum parameters for creating a course/content.
{
"name":"Amazon EKS",
"url":"https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html",
"external_id":"api-0202",
"prices_data":[]
}
Response of above request (Minimum payload):
{
"message":"Transaction for course started in background.",
"data":{
"id":"cfe751f6-7bd3-43cf-9f0e-f3e5f09bd6b3",
"payload":{
"name":"Amazon EKS",
"external_id":"api-0202",
"content_type":"course",
"prices_data":[],
"url":"https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html",
"status":"active"
},
"http_method":"POST",
"status":"initiated",
"response":{}
}
}
Sample Body (without Language)- If the language is to be set as unspecified (or any one language for all the contents that are created through this
source - which is selected in the source configuration), use the below body. Note that if the language is stored as unspecified, it will be visible to all users
irrespective of the user's language
{
"name":"AWS Glue: How It Works",
"external_id":"api-9001",
"course_type":"article",
"content_type":"article",
"is_private":false,
"duration_sec":1900,
"url":"https://docs.aws.amazon.com/glue/latest/dg/how-it-works.html",
"description": "Amazon Web Services Glue uses other AWS services to orchestrate your ETL (extract,
transform, and load) jobs to build a data warehouse. AWS Glue calls API operations to transform your data,
create runtime logs, store your job logic, and create notifications to help you monitor your job runs. The AWS
Glue console connects these services into a managed application, so you can focus on creating and monitoring
your ETL work. The console performs administrative and job development operations on your behalf. You supply
credentials and other properties to AWS Glue to access your data sources and write to your data warehouse.",
"published_at":"2015-11-21",
"status":"active",
"level":"advanced",
"tags":[
"saas",
"analytics"
],
"prices_data":[
{
"amount":300,
"currency":"INR"
},
{
"amount":4,
"currency":"USD"
}
],
"image_url":"https://media.graphcms.com/W9G8796QQYyFybiP2u9L"
}
Response of above request (without Language):
{
"message":"Transaction for course started in background.",
"data":{
"id":"29743d4f-cecd-43cb-a1ca-be993bb76608",
"http_method":"POST",
"status":"initiated",
"response":{
}
}
}
Sample Body (with Language)
Request for creating content with Multiple Languages
{
"name": "Amazon EKS",
"url": "https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html",
"external_id": "api-9002",
"course_type": "article",
"content_type": "article",
"is_private": false,
"duration_sec": 1900,
"published_at": "2019-12-21",
"status": "active",
"level": "beginner",
"tags": [
"docker",
"kubernetes"
],
"prices_data": [
{
"amount": 200,
"currency": "INR"
},
{
"amount": 2.5,
"currency": "USD"
}
],
"image_url": "https://d15shllkswkct0.cloudfront.net/wp-content/blogs.dir/1/files/2018/06/Screenshot-2018-6-
6-Amazon-EKS-managed-Kubernetes-service.png",
"languages_attributes": [
{
"language_code": "en",
"title": "What Is Amazon EKS?",
"url": "https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html",
"description": "Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it
easy for you to run Kubernetes on AWS without needing to stand up or maintain your own Kubernetes control
plane. Kubernetes is an open-source system for automating the deployment, scaling, and management of
containerized applications."
},
{
"language_code": "fr",
"title": "Présentation d'Amazon EKS",
"url": "https://docs.aws.amazon.com/fr_fr/eks/latest/userguide/what-is-eks.html",
"description": "Amazon Elastic Kubernetes Service (Amazon EKS) est un service géré qui vous permet
d'exécuter facilement Kubernetes sur AWS sans devoir installer ni gérer votre propre plan de contrôle
Kubernetes. Kubernetes est un système open source conçu pour l'automatisation du déploiement, la mise à
l'échelle et la gestion des applications de conteneur."
}
]
}
{
"message": "Transaction for course started in background.",
"data": {
"id": "0aa2c88f-dc9b-49ca-a5a6-42cc48c278e0",
"http_method": "POST",
"status": "initiated",
"response": {}
}
}
Sample Body (for free courses) - Note that the prices_data field is to be passed as an empty array
Request for creating content with no price data
{
"name": "Free Online courses for AWS",
"url": "https://www.udemy.com/course/aws-certified-solution-architect-associate-2019/",
"external_id": "api-9003",
"course_type": "course",
"content_type": "course",
"is_private": false,
"duration_sec": 10644,
"published_at": "2019-02-01",
"status": "active",
"level": "intermediate",
"tags": [
"cloud",
"saas"
],
"prices_data": []
,
"image_url": "https://prod-discovery.edx-cdn.org/organization/banner_images/31705519-3082-4c18-aa23-
1caf9a038b1c-7656e4545134.png",
"languages_attributes": [
{
"language_code": "en",
"title": "Free Online courses for AWS",
"url": "https://www.udemy.com/course/aws-certified-solution-architect-associate-2019/",
"description": "Amazon Web Services (AWS) is the world’s most comprehensive & broadly adopted cloud
platform, offering over 165 fully featured services from data centers globally, including compute, storage,
databases, analytics, networking, mobile, developer tools, management tools, IoT, security and enterprise
applications.. Millions of customers – including the fastest-growing startups, largest enterprises, and leading
government agencies –trust AWS to power their infrastructure, become more agile, and lower costs. Browse free
online courses in a variety of subjects. Amazon Web Services courses found below can be audited free or
students can choose to receive a verified certificate for a small fee. Select a course to learn more."
}
]
}
Response of above request (for free courses):
{
"message": "Transaction for course started in background.",
"data": {
"id": "a12ed5c8-0041-4b66-8b1a-c4155142b1e7",
"http_method": "POST",
"status": "initiated",
"response": {
}
}
}
Attribute | Description | Value(s) | Default (used if the attribute is | Mandatory |
---|---|---|---|---|
not sent in the request body) | ||||
name | Name to be displayed on the smart card | Name/Title | Yes | |
url | URL of the content where the content can be consumed | Yes | ||
external_id | The unique Id on the external system's side should be passed here to enable edcast to handle updates. | Yes | ||
content_type | The content type should be one of - article / course / video . It can be used for further filtering search results. | article / course / video | course | No |
is_private | Reserved for future purpose | FALSE | FALSE | No |
duration_sec | Duration in seconds | No | No | |
published_at | Displayed as Published on in the standalone view | No | No | |
status | Used when archiving a course. Note - activating a content once archived is not supported. | active / archived | active | No |
level | BIA Level displayed on the card | beginner / intermediate / advanced | No | No |
skills[] | Array of Strings that can be used to search | No | No | |
tags[] | Array of Strings that can be used to search | No | No | |
image_url | Image URL (not downloaded , will be used in the src attribute of img tag on the UI) | Edcast LXP will show a stock image if this is not provided / if the image could not be loaded from this URL | No | |
languages_attributes[] | Array of objects that define the title , url & description in the respective language | No | No | |
languages_attributes[]. language_code | 2 character language codes e.g. en , fr | No | No | |
languages_attributes[]. title | No | No | ||
languages_attributes[]. url | No | No | ||
languages.attributes[]. description | No | No | ||
prices_data[] | Array of Prices (INR & USD). The field is mandatory. If the content already exists, the previous value will be overwritten. It is required to pass an empty array if the price is not to be passed to edcast. | "Free" | Yes. If price is not applicable, it is expected to send empty array | |
prices_data[].amount | Any Positive Decimal Value | No | No | |
prices_data[].currency | INR / USD | No | No | |
expiration_date | By this date Course will be auto expired in LXP | YYYY-MM-DD HH:MM:SS | No |
Note: For entitlement parameters i.e. restricted_group_ids, group_ids, channel_ids we will associate to channels/groups which are present in params other
channels/groups will be ignored, even if they are added from LXP UI.
For example, If content first restricted to group A and from LXP UI same content restricted to group B. If update request for the same content has restricted
group C value only, then content will be restricted to group C only removing content restriction from group A & B.
Search Results
Standalone view ( after clicking on the card ) shows the description, published date , level, duration , tags, price
Searching by Tags
Filtering by Content Type
Fetch Contents
-
URL
LMS HOST/api/developer/v2/courses.json?offset=0&limit=50&return_total_count=true -
Method
GET -
Headers
Header Name | Value |
---|---|
Accept | application/json |
content-type | application/json |
Authorization | Bearer AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE |
Example Response
{
"data": [
{
"id": "f51f50cd-xxxx-xxxx-fcf6136b1a99",
"name": "Machine learning",
"description": "Machine learning",
"images": [
{
"url": "https://example.com/media/images/Course_280x140.png"
}
],
"url": "https://example.com/cours000000000248675",
"external_id": "cours000000000248675",
"additional_metadata": {
"duration": 2360,
"external_id": "cours000000000248675"
},
"source_id": "[Source_id]",
"organization_id": [Organization id],
"tags": [],
"published_at": "2021-01-21T00:00:00.000Z",
"duration": null,
"duration_sec": 2360,
"restricted_groups": [],
"groups": [],
"channels": [],
"ecl_id": "f51f50cd-xxxx-xxxx-fcf6136b1a99",
"is_private": false,
"prices_data": [],
"ecl_source_id": "[Source_id]"
},
{
"id": "f51f50cd-xxxx-xxxx-fcf6136b1199",
"name": "Machine learning",
"description": "Machine learning new",
"images": [
{
"url": "https://example.com/media/images/Course_280x140.png"
}
],
"url": "https://example.com/cours000000000248676",
"external_id": "cours000000000248676",
"additional_metadata": {
"duration": 2360,
"external_id": "cours000000000248676"
},
"source_id": "[Source_id]",
"organization_id": [Organization id],
"tags": [],
"published_at": "2021-01-21T00:00:00.000Z",
"duration": null,
"duration_sec": 2360,
"restricted_groups": [],
"groups": [],
"channels": [],
"ecl_id": "f51f50cd-xxxx-xxxx-fcf6136b1199",
"is_private": false,
"prices_data": [],
"ecl_source_id": "[Source_id]"
}
],
"total_count": 104
}
Creating Assignments
-
URL
LMS HOST/api/developer/v2/user_courses.json -
Method
POST -
Headers
Header Name | Value |
---|---|
Accept | application/json |
content-type | application/json |
Authorization | Bearer AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE |
- Sample Body
{
"email_id": "[email protected]",
"status": "assigned",
"external_id": "api-9001",
"due_date": "2023-11-02T13:55:00Z",
"assigned_date": "2023-05-02T13:55:00Z"
}
Attribute | Description | Value(s) | Default (used if the attribute is not sent in the request body) |
---|---|---|---|
email_id | Email id of the user to whom the content has to be assigned | ||
status | assigned / withdraw / completed/ Started | assigned | |
external_id | Id of the course as passed during content creation | ||
due_date | Optional . It is the due date by which the user is expected to complete the assignment | will accept value in '2020-05-02T13:55Z'(YYYY-MM-DD) format. | |
assigned_date | will accept value in '2020-05-02T13:55Z'(YYYY-MM-DD) format. | Date when the request was received | |
end_date | To be sent as the date when the user completed the assignment (alongwith status = completed) | will accept value in '2020-05-02T13:55Z'(YYYY-MM-DD) format. |
The user is able to check his / her assignment in the UI as below. The user in the Assigned By is the user selected in the Assignor during the source
configuration
Removing Assignments
Pass the status as withdraw
-
URL
LMS HOST/api/developer/v2/user_courses.json -
Method
POST -
Headers
Header Name | Value |
---|---|
Accept | application/json |
content-type | application/json |
Authorization | Bearer AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE |
- Sample Body
{
"email_id": "[email protected]",
"status": "withdraw",
"external_id": "api-0001"
}
Marking an Assignment as Completed
Pass status completed & end_date with the date when the user completed it
-
URL
LMS HOST/api/developer/v2/user_courses.json -
Method
POST -
Headers
Header Name | Value |
---|---|
Accept | application/json |
content-type | application/json |
Authorization | Bearer AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE |
- Sample Body
{
"email_id": "[email protected]",
"status": "completed",
"external_id": "api-9001",
"end_date": "2023-11-02T13:55:00Z"
}
Check Status of a request accepted
When we submit a request to create / update a record, the response contains a transaction Id . e.g. on line 4 below (data.id)
{
"message": "Transaction for course started in background.",
"data": {
"id": "0aa2c88f-dc9b-49ca-a5a6-42cc48c278e0",
"http_method": "POST",
"status": "initiated",
"response": {}
}
}
to get the status of the transaction use the below endpoint
-
URL
LMS HOST/api/developer/v2/request_data/{{tx_id}} -
Method
GET -
Headers
Header Name | Value |
---|---|
Accept | application/json |
content-type | application/json |
Authorization | Bearer AUTH_TOKEN_FROM_AUTHENTICATION_API_RESPONSE |
Example:
Response for Request that is in progress (has been initiated)
{
"response": "success",
"data": {
"id": "29743d4f-cecd-43cb-a1ca-be993bb76608",
"http_method": "POST",
"status": "initiated",
"response": {
"message": "Transaction for course api-9001 is successful."
}
}
}
Response for Request that has been successfully executed
{
"response": "success",
"data": {
"id": "29743d4f-cecd-43cb-a1ca-be993bb76608",
"http_method": "POST",
"status": "success",
"response": {
"message": "Transaction for course api-9001 is successful."
}
}
}
Throttling
All API calls are throttled at 300 requests per minute per client. The response will be HTTP status 429 if this limit is exceeded
Updated 2 months ago