📙
Sunbird Lern
AskDot
  • LEARN
    • Overview
    • Functional Capabilities
    • Technical Architecture
      • Technical Architecture Diagram
      • Tech Stack
    • Dependencies
    • Product Roadmap
  • USE
    • Overview
    • Release Notes
      • Release V 8.0.0 (Ongoing)
      • Release V 7.0.0
      • Release V 5.4.0
      • Release V 5.3.0
      • Release V 5.2.0
      • Release V 5.1.0
      • Release V 5.0.1
      • Release V 5.0.0
      • Release V 4.10.0
      • Release V 4.9.0
      • Release V 4.8.0
      • Release V 4.7.0
    • Developer Guide
      • USER & ORG SERVICE
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Keycloak Local setup
          • Additional Installation Dependencies:
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
              • User
              • Organisation
              • System Settings
              • Role
              • Bulk Upload Process
              • Tenant Preference
              • Cassandra Migration Version
              • User Consent
              • Email Template
              • OTP
              • Page Management (LMS Service)
              • Location
              • User Notes
              • Deprecated
          • Elastic Search
          • Redis
        • APIs
          • User Management
            • User Deletion API
            • Ownership Transfer API
          • Organisation Management
          • Location Management
          • Consent Management
          • OTP Services
          • Tenant Configurations
          • Bulk Upload
          • System Settings
          • API Management Service
          • Data Sync
          • Notification APIs
        • Flink Jobs
          • User Cache Updater
          • User Deletion Cleanup Flink Job
          • Ownership Transfer Flink Job
        • Reports
          • Standard Exhaust
            • State Admin Geo report
            • State Admin Report
          • Other Jobs
            • User Cache Indexer Job
            • Delete Users Assets Report
          • Data Products Developer Installation
            • System Requirements
            • Tech Stack
            • Installation Dependencies
            • Local installation of data-products
            • Server setup Guide
            • Installation Configuration
            • Data-product creation guide
            • Troubleshooting a data-product
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
          • System Settings
          • Email Configuration
          • SMS Configuration
          • OTP based SMS Configuration
        • Roles
          • System Roles
          • User Roles
          • RBAC
        • Dependencies
        • Keycloak on Sunbird
        • How to Guide
          • Create Organization
          • Create User
          • Add new user type & location
        • Single Sign-on with Sunbird
        • Caching and Denormalising User Metadata
          • ETLUserCacheUpdaterJob
          • UserCacheUpdaterFlinkJob
        • Unit Tests and Code Coverage
        • FAQs
      • LMS(BATCH) SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
        • Data Models
          • Cassandra
            • Data Dictionary
          • ElasticSearch
          • Redis
        • APIs
        • Flink Jobs
          • Merge User Courses
          • Relation Cache Updater
          • Activity Aggregate Updater
          • Assessment Aggregator
          • Enrolment Reconciliation
          • Collection Certificate Pre-Processor
          • Collection Certificate Generator
        • Reports
          • On-Demand Exhaust
            • Response Exhaust
            • User Info Exhaust
            • Progress Exhaust
          • Other Jobs
            • Collection Summary Job
            • Course Batch Status Updater Job
            • Cassandra Migrator Job
            • Score Metric Migration Job
            • Assessment Score Correction Job
            • Collection Reconciliation Job
            • Course Enrollment Job
            • Course Consumption Job
        • Logs, Telemetry Events
        • Configuration
          • System Configuration
          • Functional Configuration
        • Dependencies
        • Certificate Registry and Credentialing using Sunbird-RC
          • Configuring PublicKey in Sunbird-RC
          • Server Setup guide for Sunbird-RC
          • API Guide For Sunbird-RC
        • Certificate Flow
          • Certificates Creation and Configuration
        • FAQs
      • GROUPS
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Cassandra
            • Data Dictionary
          • Redis
        • APIs
          • Create Group
        • Logs, Telemetry Events
          • UI Telemetry Events
          • Service Telemetry Events
        • Configuration
          • Functional Configurations
        • Design References
        • Dependencies
        • Unit Tests and Code Coverage
      • NOTIFICATION SERVICE
        • Features/Core Capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
          • Source Code
          • Installation Configuration
        • Data Models
          • Data Dictionary
        • APIs
        • Flink Jobs
        • Logs, Telemetry Events
        • Configuration
          • Functional Configurations
        • Dependencies
        • Unit Tests and Code Coverage
      • DISCUSSION FORUM
        • Features/Core capabilities
        • Architecture
          • Code Flow
        • Developer Installation
          • System Requirements
          • Tech Stack
          • Installation Guide
            • Nodebb setup
            • Discussion Middleware Setup
            • Discussion Middleware
            • Discussion forum integration with any application
            • Discussion-UI setup along with demo application.
            • Sunbird-lern portal for DF
          • Source Code
        • APIs
          • Category APIs
          • User APIs
          • Post APIs
          • Topic APIs
          • Forum APIs
        • Context Schema
        • Configurations
          • Nodebb Admin panel settings
          • Discussion MW & Nodebb System Config
        • Telemetry Events
        • Dependencies
      • ML SERVICE
        • DATA PIPELINE (Flink Jobs)
          • Program User Info
            • Component Diagram
            • Data Model
            • Folder Structure
          • Ml User Delete
            • Component Diagram
            • Data Model
            • Folder Structure
        • DATA PRODUCTS
          • Program Exhaust
            • Component Diagram
            • Folder Structure
    • Server Installation
    • Dependency setup
    • Deprecation
      • Release-5.4.0
    • Jenkins Jobs
    • Release Calendar
    • Learn More
      • Tech References
      • Telemetry Processing
      • Data Dictionary
        • Sample Data
      • Delete User Functionality
      • Asset Ownership Transfer
    • FAQs
  • Engage
    • Discuss
    • Contribute to Sunbird Lern
    • Raise an Issue
    • Contribution Guidelines
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. USE
  2. Developer Guide
  3. LMS(BATCH) SERVICE

APIs

PreviousRedisNextFlink Jobs

Last updated 1 year ago

Was this helpful?

API Documentation:

Refer to **** the below various API documentation related to all the different APIs that are being consumed with in all the batch jobs.

Course Batch Management APIs are listed below:

Course Enrolment APIs are listed below:

Course Progress APIs are listed below:

Course Batch Certificates APIs are listed below:

Group Activity Aggregator

Collection Summary

Collection Summary(https://staging.open-sunbird.org/report/v1/collection/summary)

POST

This API gives the collection summary, like the total number of enrolments, completion count, count of certificates issued.

Request Body

Name
Type
Description

request*

Object

filters*

Object

Search filters

collectionId*

String

Id of the collection

batchId*

String

Id of the batch

group_by

String Array

"state", "dist"

intervals

String

2019-09-23T00:00:00.000Z/2019-09-24T00:00:00.000Z" StartDate - Batch Start Date and Default EndDate - Current Date

{
  "result": {
    "collectionId": "", // Collection/CourseId
    "name": "", // Collection Name
    "batchId": "", // Batch Identifier
    "enrolmentCount": "",
    "completionCount": "",
    "certificatesIssuedCount": "",
    "summary": {  // Summary by state and district level
      "state": {
        "enrolmentCount": "",
        "completionCount": ""
      },
      "district": {
        "enrolmentCount": "",
        "completionCount": ""
      }
    }
  }
}

Page APIs

Get Specific Page Resources

get

This API is associated with fetching specific resources.

  • The endpoint for Get Specific Page Resources is /read/{pageName}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Path parameters
pageNamestringRequired

Please append a valid Section Id to the request URL

Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which get specific page resources request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Responses
200
OK ! Successful operation."get specific page resources" operation was successfully executed.
application/json
Responseall of

Page Read Response

and
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
get
GET /api/data/v1/page/read/{pageName} HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: text
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
{
  "id": "api.page.read.Course",
  "ver": "v1",
  "ts": "2020-12-14 10:30:12:868+0000",
  "params": {
    "resmsgid": null,
    "msgid": "829f92fa-ef96-4250-a9b2-1a169e8ff59d",
    "err": null,
    "status": "success",
    "errmsg": null,
    "responseCode": "OK"
  },
  "result": {
    "page": {
      "name": "Course",
      "id": 1228382478150860800,
      "portalSections": {
        "display": "{\"name\":{\"en\":\"Latest Courses\"}}",
        "alt": null,
        "description": null,
        "index": 1,
        "sectionDataType": "course",
        "imgUrl": null,
        "searchQuery": "{\"request\":{\"filters\":{\"contentType\":[\"Course\"],\"objectType\":[\"Content\"],\"status\":[\"Live\"]},\"sort_by\":{\"lastPublishedOn\":\"desc\"},\"limit\":10}}",
        "name": "Latest Courses",
        "id": 1228382278062080000,
        "dynamicFilters": null,
        "dataSource": null,
        "status": 1,
        "group": 1
      },
      "appSections": {
        "display": "{\"name\":{\"en\":\"Latest Courses\",\"hi\":\"????????\"}}",
        "alt": null,
        "description": null,
        "index": 1,
        "sectionDataType": "course",
        "imgUrl": null,
        "searchQuery": "{\"request\":{\"filters\":{\"contentType\":[\"Course\"],\"objectType\":[\"Content\"],\"status\":[\"Live\"]},\"sort_by\":{\"lastPublishedOn\":\"desc\"},\"limit\":10}}",
        "name": "Latest Courses",
        "id": 1228382278062080000,
        "dynamicFilters": null,
        "dataSource": null,
        "status": 1,
        "group": 1
      }
    }
  }
}

Fetch Section Details by Id

get

This API is associated with fetching specific section details.

  • The endpoint for Fetch Section Details by Id is /section/read/{sectionId}
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Path parameters
SectionIdstringRequired

Please append a valid Section Id to the request URL

Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
  • Multipart/form-data
  • Application/x-www-form-urlencoded
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which Fetch Section Details request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Responses
200
OK ! Successful operation."fetching section details" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
get
GET /api/data/v1/page/section/read/{SectionId} HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: text
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
{
  "id": "api.page.section.read",
  "ver": "v1",
  "ts": "2020-12-16 08:33:54:060+0000",
  "params": {
    "resmsgid": null,
    "msgid": "5d809eaf-525b-4f96-b3f1-798636b55ecf",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "section": {
      "updatedBy": null,
      "display": "{\"name\":{\"en\":\"Ongoing Courses\"}}",
      "alt": null,
      "description": null,
      "updatedDate": null,
      "sectionDataType": "coursebatch",
      "imgUrl": null,
      "createdDate": null,
      "createdBy": null,
      "searchQuery": "{\"request\":{\"query\":\"\",\"filters\":{\"status\":\"1\"},\"limit\":10,\"sort_by\":{\"createdDate\":\"desc\"}}}",
      "name": "Ongoing Course",
      "id": 127029938411765760,
      "dynamicFilters": null,
      "dataSource": "batch",
      "status": 1
    }
  }
}

Fetch Page Settings

get

This API is associated with fetching the settings of a page.

  • The endpoint for Fetch Page Settings is /section/list
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
  • Multipart/form-data
  • Application/x-www-form-urlencoded
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which fetch settings request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Responses
200
OK ! Successful operation."fetch settings" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
get
GET /api/data/v1/page/section/list HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: text
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
{
  "id": "api.page.section.list",
  "ver": "v1",
  "ts": "2020-12-16 08:45:22:994+0000",
  "params": {
    "resmsgid": null,
    "msgid": "04c00561-c3af-46a9-924d-ab891e1b62a8",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": [
      {
        "display": "{\"name\":{\"en\":\"Latest Courses\"}}",
        "alt": null,
        "description": null,
        "sectionDataType": "ContentBrowser",
        "imgUrl": null,
        "searchQuery": "{\"request\":{\"filters\":{\"contentType\":[\"Course\"],\"objectType\":[\"Content\"],\"status\":[\"Live\"]},\"sort_by\":{\"lastPublishedOn\":\"desc\"},\"limit\":10}}",
        "name": "Latest Courses",
        "id": 131191751772733440,
        "dynamicFilters": null,
        "dataSource": null,
        "status": 1
      },
      {
        "display": "{\"name\":{\"en\":\"NCC\"}}",
        "alt": null,
        "description": null,
        "sectionDataType": "Content",
        "imgUrl": null,
        "searchQuery": "{\"request\":{\"filters\":{\"contentType\":[\"Course\"],\"status\":[\"Live\"],\"objectType\":[\"Content\"],\"createdFor\":[\"0129902071599595522\"],\"subject\":[\"NCC\"]},\"sort_by\":{\"lastPublishedOn\":\"desc\"},\"limit\":10}}",
        "name": "NCC",
        "id": 129916933832212480,
        "dynamicFilters": null,
        "dataSource": null,
        "status": 1
      }
    ]
  }
}

Add certificate template to a course batch

patch

This API allows you to attach certificate templates.

  • On request, the _ /template/add_ endpoint attaches a template to the course batch.
  • All fields marked with an * are mandatory
  • The mandatory fields cannot be null or empty
  • Backend route: http://lms-service:9000/v1/course/batch/cert/template/add
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource.Possible media types can be Application/json

tsstringOptional

The timestamp at which the Add certificate template request was sent.

X-msgidstringOptional

A unique ID that identifies the request, in case the same API is executed multiple times.

x-authenticated-user-tokenstringRequired

The access token of the registered user sending the given API request. This is an alphanumeric string.

AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received here.

Body
all ofOptional
and
Responses
200
OK ! Operation successful."Add Certificate template" operation was executed successfully.
application/json
400
BAD REQUEST. The "Add Certificate template" operation failed. Input for a mandatory parameter may be missing.
application/json
401
Unauthorized
application/json
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
patch
PATCH /api/course/batch/cert/v1/template/add HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
x-authenticated-user-token: text
Accept: */*
Content-Length: 341

{
  "id": "text",
  "ver": "text",
  "ets": 1,
  "params": {
    "msgid": "text",
    "did": "text"
  },
  "request": {
    "batch": {
      "courseId": "text",
      "batchId": "text",
      "template": {
        "identifier": "text",
        "criteria": {
          "enrollment": {
            "status": "2"
          }
        },
        "signatoryList": [
          {
            "name": "text",
            "id": "text",
            "designation": "CEO",
            "image": "text"
          }
        ],
        "issuer": {
          "name": "text",
          "url": "text",
          "publicKey": [
            7,
            8
          ]
        }
      }
    }
  }
}
{
  "id": "api.course.batch.cert.template.add",
  "ver": "v1",
  "ts": "2020-12-03 05:15:43:693+0000",
  "params": {
    "resmsgid": null,
    "msgid": "dcef916a-bbf0-48b6-bb20-2e4b9e90745d",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS"
  }
}

remove certificate template from course batch

patch

This API is associated with detaching certificate templates.

  • The _ /template/remove_ endpoint detaches a template from the course batch.
  • All fields marked with an * are mandatory
  • Required fields cannot be null or empty
  • Backend Route: http://lms-service:9000/v1/course/batch/cert/template/remove
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource.Possible media types can be Application/json

tsstringOptional

The timestamp at which the remove certificate template request was sent.

X-msgidstringOptional

A unique ID that identifies the request in case the same API is executed multiple times.

x-authenticated-user-tokenstringRequired

The access token of the registered user sending the given API request. This is an alphanumeric string.

AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received here.

Body
all ofOptional
and
Responses
200
OK ! Operation successful."Remove Certificate template" operation was executed successfully.
application/json
400
BAD REQUEST. The "Remove Certificate template" operation failed. Input for a mandatory parameter may be missing.
application/json
401
Unauthorized
application/json
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
patch
PATCH /api/course/batch/cert/v1/template/remove HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
x-authenticated-user-token: text
Accept: */*
Content-Length: 113

{
  "request": {
    "batch": {
      "courseId": "courseId",
      "batchId": "batchId",
      "template": {
        "identifier": "template Identifier"
      }
    }
  }
}
{
  "id": "api.course.batch.cert.template.remove",
  "ver": "v1",
  "ts": "2020-12-03 05:36:09:531+0000",
  "params": {
    "resmsgid": null,
    "msgid": "cac9434e-fc66-47dc-b37b-15438b3c68ab",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS"
  }
}

Create Page

post

This API is associated with creating a new page. To create a page first create the page section using section create api.make page name unique.

  • The endpoint for Create Page is /create
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
  • Multipart/form-data
  • Application/x-www-form-urlencoded
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which creating page request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Body
idstringRequiredExample: unique API ID
tsstringRequiredExample: 2013/10/15 16:16:39
paramsobjectRequired
Responses
200
OK ! Successful operation."create page" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
400
BAD REQUEST. The "create page" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
post
POST /api/data/v1/page/create HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
Content-Length: 443

{
  "id": "api.page.create",
  "ts": "2020/12/11 16:16:39",
  "params": {},
  "request": {
    "name": "Resources",
    "organisationId": "id of organisation, if you want to create page for your org only. if not pass then page will be created for all org.",
    "portalMap": [
      {
        "id": 1228383082462412800,
        "index": 1,
        "group": 1
      },
      {
        "id": 1228383384379392000,
        "index": 1,
        "group": 2
      }
    ],
    "appMap": [
      {
        "id": 1228383082462412800,
        "index": 1,
        "group": 1
      },
      {
        "id": 1228383384379392000,
        "index": 1,
        "group": 2
      }
    ]
  }
}
{
  "id": "api.page.create",
  "ver": "v1",
  "ts": "1606196636922",
  "params": {
    "resmsgid": "null,",
    "msgid": "a4b7041c-2d42-43e8-81d2-d3f3b6fbeccf",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS",
    "pageId": 131699903041208320
  }
}

Update Page Information

patch

This API is associated with updating the page information

  • The endpoint for Update Page Information is /update
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
  • Multipart/form-data
  • Application/x-www-form-urlencoded
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which update page information request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Body
idstringRequiredExample: unique API ID
tsstringRequiredExample: 2013/10/15 16:16:39
paramsobjectRequired
Responses
200
OK ! Successful operation."update page information" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
400
BAD REQUEST. The "update page" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
patch
PATCH /api/data/v1/page/update HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
Content-Length: 333

{
  "id": "unique API ID",
  "ts": "2013/10/15 16:16:39",
  "params": {},
  "request": {
    "name": "Resourcessss",
    "id": 1228394137835929600,
    "portalMap": [
      {
        "id": 1228383082462412800,
        "index": 1,
        "group": 1
      },
      {
        "id": 1228383384379392000,
        "index": 1,
        "group": 2
      }
    ],
    "appMap": [
      {
        "id": 1228383082462412800,
        "index": 1,
        "group": 1
      },
      {
        "id": 1228383384379392000,
        "index": 1,
        "group": 2
      }
    ]
  }
}
{
  "id": "api.page.update",
  "ver": "v1",
  "ts": "1606196636922",
  "params": {
    "resmsgid": null,
    "msgid": "34b7041c-2d42-43e8-81d2-d3f3b6fbeccf",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS"
  }
}

Create Page Section

post

This API is associated with creating a new section on a page.

  • The endpoint for Create Page Section is /section/create
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which create section request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Body
idstringRequiredExample: unique API ID
tsstringRequiredExample: 2013/10/15 16:16:39
paramsobjectRequired
Responses
200
OK ! Successful operation."create section" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
400
BAD REQUEST. The "create section" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
post
POST /api/data/v1/page/section/create HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
Content-Length: 335

{
  "id": "unique API ID",
  "ts": "2013/10/15 16:16:39",
  "params": {},
  "request": {
    "name": "Recommended TextBook",
    "searchQuery": {
      "request": {
        "query": "",
        "filters": {
          "language": [
            "English"
          ],
          "contentType": [
            "TextBook"
          ]
        },
        "limit": 10,
        "sort_by": {
          "lastUpdatedOn": "desc"
        }
      }
    },
    "sectionDataType": "course",
    "display": {
      "name": {
        "en": "popular story",
        "hi": "????????"
      }
    }
  }
}
{
  "id": "api.page.section.create",
  "ver": "v1",
  "ts": "1606196636922",
  "params": {
    "resmsgid": "null,",
    "msgid": "a4b7041c-2d42-43e8-81d2-d3f3b6fbeccf",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS",
    "pageId": 131735539027230720
  }
}

Update Page Section

patch

This API is associated with updating content of a section on a page.

  • The endpoint for Update Page Section is /section/update
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource. Possible media types can be:-

  • Application/json
  • Multipart/form-data
  • Application/x-www-form-urlencoded
X-msgidstringRequired

This Id Uniquely identifies a request if the same API is executed multiple times.

tsstringRequired

Time Stamp at which updating page section request was sent.

AuthorizationstringRequired

All User APIs require authorization for use. Specify the authorization key received from the administrator when placing the request for use of the API.

x-authenticated-user-tokenstringRequired

The token/key used to execute the API

Body
idstringRequiredExample: unique API ID
tsstringRequiredExample: 2013/10/15 16:16:39
paramsobjectRequired
Responses
200
OK ! Successful operation."create section" operation was successfully executed.
application/json
Responseall of

Create Content Response

and
400
BAD REQUEST. The "create section" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
500
INTERNAL SERVER ERROR ! Looks like something went wrong. These errors are tracked automatically. Try refreshing the page. If the problem persists, contact info@sunbird.org.
application/json
patch
PATCH /api/data/v1/page/section/update HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
Content-Type: application/json
X-msgid: text
ts: text
x-authenticated-user-token: text
Accept: */*
Content-Length: 389

{
  "example": {
    "request": {
      "id": 1269259447543398400,
      "name": "Linked Content",
      "searchQuery": {
        "request": {
          "facets": [
            "medium"
          ],
          "filters": {
            "primaryCategory": [
              "Course"
            ],
            "mimeType": [
              "application/vnd.ekstep.content-collection"
            ],
            "status": [
              "Live"
            ],
            "compatibilityLevel": {
              "max": 4,
              "min": 1
            }
          },
          "mode": "collection",
          "limit": 10,
          "sort_by": {
            "lastUpdatedOn": "desc"
          }
        }
      },
      "display": {
        "name": null,
        "en": "Linked Content"
      }
    }
  }
}
{
  "id": "api.page.section.update",
  "ver": "v1",
  "ts": "1606196636922",
  "params": {
    "resmsgid": "null,",
    "msgid": "a4b7041c-2d42-43e8-81d2-d3f3b6fbeccf",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS",
    "pageId": 131735539027230720
  }
}

{host}/v1/jobrequest/list

get

This API will internally call ‘/dataset/v1/request/list API in Obsrv ‘On Demand Data Exhaust API’, to list all the requests that are specific to a tag

Path parameters
tagstringRequired
Header parameters
x-authenticated-user-tokenstringOptional

User token

Example: {{auth_token}}
AuthorizationstringOptional

API Key

Example: {{kong_api_key}}
Content-TypestringOptionalExample: application/json
x-channel-idstringOptional

Organisation id of the requestor

Example: {{organisation_id}}
x-authenticated-useridstringOptional

UserId of the requester - ORG_ADMIN, COURSE_MENTOR

Example: {{requested_user_id}}
Responses
200
Successful response
application/json
get
200

Successful response

No content

UserEnrolment List

get

The UserEnrolmentList api provides the detail of a user's all enrolled CourseBatches The endpoint for UserEnrolment List is /user/enrollment/list/{{user-id}}

The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.

Authorizations
Path parameters
user-idstringRequired

Id of user for whom enrolment details we want

Query parameters
orgdetailsstringOptional

Org details related with course

Example: orgName,email
licenseDetailsstringOptional

License details related with course

Example: name,description,url
fieldsstringOptional

Different course related details can be passed

Example: contentType,topic,name,channel
batchDetailsstringOptional

Batch details can be passed to filter

Example: name,endDate,startDate,status,enrollmentType,createdBy,certificates
cachestringOptional

The batch data got updated in cache after sometime to get updated details immediately we can pass cache false

Example: cache=false
Header parameters
Content-TypestringRequired

The Content Type entity is the media type of the resource.Possible media types can be:- Application/json

Example: application/json
AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

Example: {{api-key}}
x-authenticated-user-tokenstringRequired

The alphanumeric string for accessing the API

Example: {{authToken}}
Responses
200
SUCCESS. The "User Enrolment List" operation was successful!
application/json
500
Internal Server Error
application/json
get

{host}/v1/jobrequest/submit

post

This API will internally call ‘/dataset/v1/request/submit’ API in SB-Obsrv ‘On Demand Data Exhaust API’, to submit the on demand exhaust job request. The job status will be in the submitted state. 

  • This API should encrypt the password using auto generated encryption key and pass it in the exhaust API request if the security level is L2 or L3. 
  • L1 and L4 do not need encryption keys. 
  • Fetch the security level using tenant preference APIs to check this.
  • Configure the exhaust api base url and endpoints.
Header parameters
x-authenticated-user-tokenstringOptional

User token

Example: {{auth_token}}
AuthorizationstringOptional

API key

Example: {{kong_api_key}}
Content-TypestringOptionalExample: application/json
x-channel-idstringOptional

Organisation id of the requestor

Example: {{organisation_id}}
x-authenticated-useridstringOptional

UserId of the requester - ORG_ADMIN, COURSE_MENTOR

Example: {{requested_user_id}}
Body
objectOptionalExample: {"request":{"tag":"do_2137002173427875841205_01370023185341644821","requestedBy":"fca2925f-1eee-4654-9177-fece3fd6afc9","dataset":"response-exhaust","datasetConfig":{"batchId":"01370023185341644821"},"output_format":"csv","encryptionKey":"encryption-keyencryption-keyencryption-keyencryption-keyencryption-key"}}
Responses
200
Successful response
application/json
post
POST /api/course/v1/jobrequest/submit HTTP/1.1
Host: {{host}}
Content-Type: application/json
Accept: */*
Content-Length: 312

{
  "request": {
    "tag": "do_2137002173427875841205_01370023185341644821",
    "requestedBy": "fca2925f-1eee-4654-9177-fece3fd6afc9",
    "dataset": "response-exhaust",
    "datasetConfig": {
      "batchId": "01370023185341644821"
    },
    "output_format": "csv",
    "encryptionKey": "encryption-keyencryption-keyencryption-keyencryption-keyencryption-key"
  }
}
200

Successful response

No content

GET /api/course/v1/jobrequest/list/{tag} HTTP/1.1
Host: {{host}}
Accept: */*

Course Enrol

post

The API associated with user enrolment into a courseBatch. The endpoint for Course Enrol is /enrol

The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.

Authorizations
Header parameters
AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

Example: {{api-key}}
x-authenticated-user-tokenstringRequired

The alphanumeric string for accessing the API

Example: {{authToken}}
Body
Responses
200
SUCCESS. The "Course Enrol Request" operation was successful!
application/json
400
Bad Request
application/json
500
Internal Server Error
application/json
post
POST /api/course/v1/enrol HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{api-key}}
x-authenticated-user-token: {{authToken}}
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "request": {
    "courseId": "{{course-id}}",
    "batchId": "{{batch-id}}",
    "userId": "{{user-id}}"
  }
}
{
  "id": "api.course.enroll",
  "ver": "v1",
  "ts": "2020-12-03 04:24:19:186+0000",
  "params": {
    "resmsgid": null,
    "msgid": "d8e54177-acb2-4351-8dcc-a7e6fc5c8a2f",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS"
  }
}

Course Unenrol

post

The Course Unenrol API is associated with unenrol of a user from a CourseBatch. The endpoint for Course Unenrol is /unenrol

The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.

Authorizations
Header parameters
AuthorizationstringRequired

To make use of the API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

Example: {{api-key}}
x-authenticated-user-tokenstringRequired

The alphanumeric string for accessing the API

Example: {{authToken}}
Body
Responses
200
SUCCESS. The "Course Unenrol Request" operation was successful!
application/json
400
Bad Request
application/json
500
Internal Server Error
application/json
post
POST /api/course/v1/unenrol HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{api-key}}
x-authenticated-user-token: {{authToken}}
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "request": {
    "courseId": "{{course-id}}",
    "batchId": "{{batch-id}}",
    "userId": "{{user-id}}"
  }
}
{
  "id": "api.course.unenroll",
  "ver": "v1",
  "ts": "2020-12-03 06:33:38:843+0000",
  "params": {
    "resmsgid": null,
    "msgid": "728efae3-8352-4886-8cb2-34b7b3fc41cc",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": "SUCCESS"
  }
}
GET /api/course/v1/user/enrollment/list/{user-id} HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{api-key}}
Content-Type: application/json
x-authenticated-user-token: {{authToken}}
Accept: */*
{
  "id": "api.user.courses.list",
  "ver": "v1",
  "ts": "2020-12-03 06:56:38:376+0000",
  "params": {
    "resmsgid": null,
    "msgid": "83f3347f-0d7a-4369-bde2-daae13aa5938",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "courses": [
      {
        "dateTime": 1594191696100,
        "lastReadContentStatus": 2,
        "enrolledDate": "2020-07-08 07:01:36:100+0000",
        "addedBy": null,
        "contentId": "do_11305961646828748812224",
        "active": true,
        "description": "Enter description for Course",
        "courseLogoUrl": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/do_11305961646828748812224/artifact/06_maths_book_1566813333849_1580197829074.thumb.jpg",
        "batchId": 1305961938705612800,
        "userId": "95e4942d-cbe8-477d-aebd-ad8e6de4bfc8",
        "content": {
          "ownershipType": [
            "createdBy"
          ],
          "copyright": "Sunbird",
          "channel": "b00bc992ef25f1a9a8d63291e20efc8d",
          "downloadUrl": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/ecar_files/do_11305961646828748812224/test-auto-certificate-8thjuly_1594191511275_do_11305961646828748812224_1.0_spine.ecar",
          "organisation": [
            "Sunbird"
          ],
          "language": [
            "English"
          ],
          "mimeType": "application/vnd.ekstep.content-collection",
          "variants": {
            "online": {
              "ecarUrl": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/ecar_files/do_11305961646828748812224/test-auto-certificate-8thjuly_1594191511612_do_11305961646828748812224_1.0_online.ecar",
              "size": 4936
            },
            "spine": {
              "ecarUrl": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/ecar_files/do_11305961646828748812224/test-auto-certificate-8thjuly_1594191511275_do_11305961646828748812224_1.0_spine.ecar",
              "size": 76289
            }
          },
          "leafNodes": [
            "do_11305605610466508811"
          ],
          "c_sunbird_dev_private_batch_count": 0,
          "objectType": "Content",
          "appIcon": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/do_11305961646828748812224/artifact/06_maths_book_1566813333849_1580197829074.thumb.jpg",
          "children": [
            "do_11305605610466508811"
          ],
          "primaryCategory": "Course",
          "appId": "dev.sunbird.portal",
          "contentEncoding": "gzip",
          "lockKey": "097e65a0-9c65-4198-b65c-269de9ae6072",
          "totalCompressedSize": 499149,
          "mimeTypesCount": "{\"application/vnd.ekstep.content-collection\":1,\"application/vnd.ekstep.ecml-archive\":1}",
          "contentType": "Course",
          "trackable": {
            "enabled": "Yes",
            "autoBatch": "Yes"
          },
          "identifier": "do_11305961646828748812224",
          "lastUpdatedBy": "8454cb21-3ce9-4e30-85b5-fade097880d8",
          "audience": [
            "Teacher"
          ],
          "visibility": "Default",
          "toc_url": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/do_11305961646828748812224/artifact/do_11305961646828748812224_toc.json",
          "contentTypesCount": "{\"CourseUnit\":1,\"Resource\":1}",
          "consumerId": "6533af82-f38b-429a-bcfb-681ed02a62e3",
          "childNodes": [
            "do_11305961679918694412225",
            "do_11305605610466508811"
          ],
          "mediaType": "content",
          "osId": "org.ekstep.quiz.app",
          "graph_id": "domain",
          "nodeType": "DATA_NODE",
          "lastPublishedBy": "Ekstep",
          "version": 2,
          "license": "CC BY 4.0",
          "prevState": "Draft",
          "size": 76289,
          "lastPublishedOn": "2020-07-08T06:58:31.132+00:00",
          "IL_FUNC_OBJECT_TYPE": "Content",
          "name": "Test-auto-certificate-8thjuly",
          "status": "Live",
          "code": "org.sunbird.DuGnxI",
          "credentials": {
            "enabled": "Yes"
          },
          "prevStatus": "Processing",
          "description": "Enter description for Course",
          "idealScreenSize": "normal",
          "posterImage": "https://sunbirddev.blob.core.windows.net/sunbird-content-dev/content/do_11294498061374259215/artifact/06_maths_book_1566813333849_1580197829074.jpg",
          "createdOn": "2020-07-08T06:57:43.417+00:00",
          "reservedDialcodes": "{\"U6K9M6\":0}",
          "batches": [
            {
              "createdFor": [
                "ORG_001"
              ],
              "endDate": null,
              "name": "Test-auto-certificate-8thjuly",
              "batchId": 1305961938705612800,
              "enrollmentType": "open",
              "enrollmentEndDate": null,
              "startDate": "2020-07-08",
              "status": 1
            },
            {
              "createdFor": [
                "ORG_001"
              ],
              "endDate": null,
              "name": "Test-auto-certificate-8thjuly",
              "batchId": 1306956038530662400,
              "enrollmentType": "open",
              "enrollmentEndDate": null,
              "startDate": "2020-07-22",
              "status": 1
            }
          ],
          "copyrightYear": 2020,
          "contentDisposition": "inline",
          "lastUpdatedOn": "2020-07-08T06:58:30.585+00:00",
          "licenseterms": "By creating and uploading content on DIKSHA, you consent to publishing this content under the Creative Commons Framework, specifically under the CC-BY-SA 4.0 license.",
          "SYS_INTERNAL_LAST_UPDATED_ON": "2020-07-23T12:24:29.5+00:00",
          "dialcodeRequired": "No",
          "createdFor": [
            "ORG_001"
          ],
          "lastStatusChangedOn": "2020-07-08T06:58:31.95+00:00",
          "creator": "Mentor First User",
          "IL_SYS_NODE_TYPE": "DATA_NODE",
          "os": [
            "All"
          ],
          "pkgVersion": 1,
          "versionKey": 1594191510585,
          "idealScreenDensity": "hdpi",
          "framework": "TPD",
          "depth": 0,
          "s3Key": "ecar_files/do_11305961646828748812224/test-auto-certificate-8thjuly_1594191511275_do_11305961646828748812224_1.0_spine.ecar",
          "dialcodes": [
            "U6K9M6"
          ],
          "createdBy": "8454cb21-3ce9-4e30-85b5-fade097880d8",
          "compatibilityLevel": 4,
          "leafNodesCount": 1,
          "IL_UNIQUE_ID": "do_11305961646828748812224",
          "resourceType": "Course",
          "node_id": 452442,
          "c_sunbird_dev_open_batch_count": 2
        },
        "contentStatus": {
          "do_11305605610466508811": 2
        },
        "issuedCertificates": [],
        "completionPercentage": 100,
        "courseName": "Test-auto-certificate-8thjuly",
        "certificates": [
          {
            "id": "fe2aadc6-5065-460a-98ed-4de17bc13f62",
            "lastIssuedOn": "2020-07-22T12:57:44.335+00:00",
            "name": "Course completion certificate prad",
            "token": "A8T4Q7",
            "url": "https://dev.sunbirded.org/certs/ORG_001_01305961938705612812/eedc6a60-cc1a-11ea-bff5-c98df349f522.pdf"
          }
        ],
        "completedOn": 1595422613486,
        "leafNodesCount": 1,
        "progress": 1,
        "lastReadContentId": "do_11305605610466508811",
        "courseId": "do_11305961646828748812224",
        "collectionId": "do_11305961646828748812224",
        "status": 2
      }
    ]
  }
}