📙
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. USER & ORG SERVICE
  4. APIs

API Management Service

PreviousSystem SettingsNextData Sync

Last updated 2 years ago

Was this helpful?

The API management microservice provides services to create, manage and validate API tokens to register mobile and desktop apps, and to issue and refresh API tokens of registered mobile and desktop app devices.

Get API token

post

This API is used to get the token.

  • /consumer/desktop_device/credential/register/ endpoint helps to get the token.
  • Required fields cannot be left null or empty
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
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
Responses
200
SUCCESS. The operation was successful!
application/json
Responseall of

Get Token Response

and
500
'INTERNAL SERVER ERROR. We track these errors automatically and try to set it right at the earliest. Try refreshing the page. If the problem persists contact us at info@sunbird.org.'
application/json
post
POST /api/api-manager/v2/consumer/desktop_device/credential/register HTTP/1.1
Host: staging.open-sunbird.org
Content-Type: */*
Authorization: text
Accept: */*
Content-Length: 26

{
  "request": {
    "key": "text"
  }
}
{
  "id": "text",
  "ver": "text",
  "ets": 1,
  "params": {
    "resmsgid": "text",
    "msgid": "text",
    "err": "text",
    "status": "text",
    "errmsg": "text"
  },
  "result": {
    "key": "text",
    "secret": "text",
    "token": "text"
  }
}

Get a new bearer token

post

This API is used to obtain a bearer token

  • Required fields cannot be left null or empty
Authorizations
Path parameters
consumerstringRequired

Append any text to the request URL

Example: mobile_device
Body

A unique key which helps in identifying the token

Responses
200
OK
application/json
400
Bad request
application/json
415
Unsupported media type
application/json
500
Internal Server Error
application/json
post
POST /api//api-manager/v2/consumer/{consumer}/credential/register HTTP/1.1
Host: staging.open-sunbird.org
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "request": {
    "key": "text"
  }
}
{
  "id": "ekstep.api.am.adminutil.consumer.create",
  "ver": "1.0",
  "ts": 1606915336200,
  "params": {
    "status": "successful",
    "err": null,
    "errmsg": null,
    "msgid": "",
    "resmsgid": "3c6fdb62-1dcd-49b1-a404-bcd7e2e5a0d1"
  },
  "result": {
    "key": "SunbirdUser",
    "secret": "",
    "token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1vYmlsZSJ9.eyJpc3MiOiJTdW5iaXJkVXNlciIsImlhdCI6MTYwNjkxNTMzNn0.FEZfy-Q-ljIxQRE-JYRu-9qlezDtgPcPGcbFU8mnWQGsHowxNGcYvKvkwVUnTE7BmpPeM4vbfv4d0cRL261daqZWj9nE4zXRglWFDn96Ll2rvi3Kb-AChKlANDhzh4MTqPigIOABX7ZPLMKlxiQx74Ezl5NYhyrbfgRK3_nt4kipyNahvhU1TIaD0DnVrnUPdosk1jtl3wP9tL7E3oKBHfN3BUiGKzYtfWcYrNtXkx5VXsn4EhIOE79GIn72cYqGIUK4cRftfntqKo4FMUk4sX-rbEOZNLQRk3WIl8XwhP3iZv2saZZSEq_EMrLW4aN0vPH9RgoL4QZqi96O7tBypg"
  }
}

Get a new bearer token

post

This API is used to obtain a bearer token

  • Required fields cannot be left null or empty
Authorizations
Path parameters
consumerstringRequired

Append any text to the request URL

Example: mobile_device
Body

A unique key which helps in identifying the token

Responses
200
OK
application/json
400
Bad request
application/json
415
Unsupported media type
application/json
500
Internal Server Error
application/json
post
POST /api//api-manager/v1/consumer/{consumer}/credential/register HTTP/1.1
Host: staging.open-sunbird.org
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "request": {
    "key": "text"
  }
}
{
  "id": "ekstep.api.am.adminutil.consumer.create",
  "ver": "1.0",
  "ts": 1606903294596,
  "params": {
    "status": "successful",
    "err": null,
    "errmsg": null,
    "msgid": "",
    "resmsgid": "0a0d4cc2-58c0-42e0-bd98-66004517cf00"
  },
  "result": {
    "key": "SunbirdUser",
    "secret": "tzppMyvMWJTA8Y5FUxoyvjCLswa47u7Pi",
    "token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTdW5iaXJkVXNlciIsImlhdCI6MTUxNjIzOTAyMn0.HUsyhT5jvusvN1f-Q6b9NOxAPy-HsEeC_icbpbDNjQY"
  }
}
  • POSTGet a new bearer token
  • POSTGet a new bearer token
  • POSTGet a new access token
  • POSTGet API token

Get a new access token

post

This API is used to obtain a new access token

  • Required fields cannot be left null or empty
Authorizations
Body

Refresh Token

refresh_tokenstringRequired
Responses
200
OK
application/json
400
Bad request
application/json
415
Unsupported media type
text/html
500
Internal Server Error
text/html
post
POST /api//auth/v1/refresh/token HTTP/1.1
Host: staging.open-sunbird.org
Authorization: Bearer JWT
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 24

"refresh_token='text'"
{
  "id": "api.refresh.token",
  "ver": "1.0",
  "ts": 1606816047013,
  "params": {
    "resmsgid": "abf4051d-1449-4ea6-8c56-af44faa4c86e",
    "status": "successful",
    "err": null,
    "errmsg": null
  },
  "result": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2VzczAifQ.eyJhdWQiOiJhbmRyb2lkIiwic3ViIjoiZjo1MGY5NjdkNC1iOWRiLTQ1MjgtOTUwYy1iOWYwMzMyZTYzYmE6YTFlNjRiNDEtMTZjZC00N2Y3LTk4OWQtYTYwNWU3NDBkMDQwIiwiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLm9yZy9hdXRoL3JlYWxtcy9zdW5iaXJkIiwidHlwIjoiQmVhcmVyIiwiZXhwIjoxNjA2OTI5MjA0LCJpYXQiOjE2MDY4ODYwMDR9.cR4tzLWL0hD066lHARPcPs7INnY97ZzeBGqs4JCWaHi1Y22-hFxBv5xxY0JHanydeagc8a0Z3F4ZdDqlICClrIPJB1qcMi1TUjmCiabS-brVL9LMuSwV1X_Gri1o-K5uYZL87BmLeW6K7mfRZ1XoEfweGhBgVg3hvAOiLdbzYU_zGK26GCj_oTtuMIF0aiR0MksSi5HV1vhtH-BXP_aCgi_2zSK_NKayGg-yjbGPFWFV25Aib9_mlKKygRluCvDizCWT50EV7Q1TVn11qkXNP943A0hR9ko_GQRReHLG3NQsFP9fm6PNuns2-t9bwr27Vjdlo9LCCzGkioGTMBxnIg",
    "expires_in": 0,
    "refresh_expires_in": 0,
    "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFjY2Vzc3B1YjAifQ.eyJqdGkiOiIyNGYwOTRkOS1mZjBlLTQwNzQtODA4MC0yOTUwYjk2MjQwMjYiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjA2ODg1NzI5LCJpc3MiOiJodHRwczovL2V4YW1wbGUub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQ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