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. GROUPS

APIs

PreviousRedisNextCreate Group

Last updated 20 days ago

Was this helpful?

API Document:

Activity Related API

Group API

Group Activity Aggregator

post

This API is used for reading the current progress of the course (content) consumed by group members. For example, the mentor/user can view and check the progress of a specific activity.

  • The endpoint for Group Activity Aggregator is /agg

  • 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:- \n - application/json'

Example: application/json
x-authenticated-user-tokenstringRequired

'The registered user token/key to authenticate user and execute the API.'

Example: {{authToken}}
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}}
Body
Responses
200
SUCCESS. The "Group Activity Aggregator" operation was successful!
application/json
500
Internal Server Error
application/json
post
POST /api/data/v1/group/activity/agg HTTP/1.1
Host: staging.open-sunbird.org
Authorization: {{api-key}}
Content-Type: application/json
x-authenticated-user-token: {{authToken}}
Accept: */*
Content-Length: 93

{
  "request": {
    "groupId": "{{group-id}}",
    "activityId": "{{activity-id}}",
    "activityType": "Course"
  }
}
{
  "id": "api.group.activity.agg",
  "ver": "v1",
  "ts": "2020-11-27 16:29:46:161+0000",
  "params": {
    "resmsgid": null,
    "msgid": "849f418c-7f6e-4a10-9c5c-16b15f8ea86e",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "activity": {
      "id": "{{activity-id-invalid}}",
      "type": "Course",
      "agg": [
        {
          "metric": "enrolmentCount",
          "lastUpdatedOn": 1606494586160,
          "value": 0
        }
      ]
    },
    "groupId": "b0c4a645-807e-41c7-972e-5c48c5b5e5e7",
    "members": []
  }
}
  • API Document:
  • POSTGroup Activity Aggregator
  • POSTCreate Group
  • PATCHUpdate Group
  • POSTList Groups by User
  • POSTDelete Group by User

Create Group

post

This API is used to create a group

  • The endpoint for Create Group is /group/v1/create

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

Authorizations
Header parameters
tsstringOptional

Timestamp at which given API request is sent.

X-msgidstringOptional

This ID uniquely identifies a request if the same API is executed multiple times.

AuthorizationstringRequired

To make use of any Group 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.

x-authenticated-user-tokenstringOptional

It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password

x-authenticated-forstringOptional

Managed User token of registered MUA user performing given API request.

Body

Create Group Object

Responses
200
OK ! Successful operation."Create Group" operation was successfully executed.
application/json
400
BAD REQUEST. The "Create Group" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
401
Unauthorized User
application/json
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/group/v1/create HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 86

{
  "request": {
    "name": "Study Group",
    "description": "This groups belongs to  group study"
  }
}
{
  "id": "api.group.create",
  "ver": "v1",
  "ts": "2020-12-01 20:52:25:226+0000",
  "params": null,
  "result": {
    "groupId": "682473c2-12ba-4a89-b8db-67c2c65ca97a"
  },
  "responseCode": 200
}

Update Group

patch

This API is used for updating the group related details. This can also be used to add/edit/remove members of a group and also to add/remove activitties of a group. This API can add details partially as well, for example, one member in the request could not be added, because that member is inactive or id doesn't exist, still other properties in the request is updated. If a member is not added, only the status of that will be shown in the “errors” array in response.

  • The endpoint for Update Group is /group/v1/update

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

  • Once group suspended following operation can only be performed :-

    1. All member are eligible to leave the group.

    2. Creator will be able to delete the group.

    3. Admin will be able to reactivate the group.

    4. All other operations are not permitted once group is suspended.

Header parameters
tsstringOptional

Timestamp at which given API request is sent.

X-msgidstringOptional

This ID uniquely identifies a request if the same API is executed multiple times.

AuthorizationstringRequired

Specify authorization key (format: Bearer api-key) received from administrator when performing given API request.

X-Authenticated-User-TokenstringRequired

Access token of registered user performing given API request.

x-authenticated-forstringOptional

Managed User token of registered MUA user performing given API request.

Body
all ofOptional
Responses
200
OK ! Successful operation."Update Group" operation was successfully executed.
application/json
Responseall of

Update response for a Group API

400
BAD REQUEST. The "Update Group" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
401
Unauthorized User
application/json
404
Resource not found. The "Update Group" operation failed ! The possible reason for failure is that requested resource not found. here resource is group.
application/json
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
patch
PATCH /api/group/v1/update HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
X-Authenticated-User-Token: text
Content-Type: application/json
Accept: */*
Content-Length: 108

{
  "request": {
    "groupId": "groupid",
    "name": "Demo Group",
    "description": "Group name is changed for demo purpose"
  }
}
{
  "id": "d1232323",
  "ver": "3.0",
  "ets": "139832389023",
  "responseCode": "200",
  "result": {
    "response": "success"
  }
}

List Groups by User

post

This API is used for listing groups of a particular user.

  • The endpoint for List Group is /group/v1/list

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

Header parameters
AuthorizationstringRequired

To make use of any Group 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.

x-authenticated-user-tokenstringRequired

It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password

x-authenticated-forstringOptional

Managed User token of registered MUA user performing given API request. From this LUA and MUA id are seperated and LUA is validated against user_id in x-authenticated-user-token

tsstringOptional

Timestamp is a sequence of characters or encoded information identifying when the list group API call occurred, usually it gives date and time of day, mostly accurate to a small fraction of a second.

X-msgidstringOptional

This ID uniquely identifies a request if the same API is executed multiple times.

Body

List group request

Responses
200
OK ! Successful operation."List Group" operation was successfully executed.
application/json
400
BAD REQUEST. The "List Group" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
401
Unauthorized User
application/json
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/group/v1/list HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
x-authenticated-user-token: text
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "reuqest": {
    "userId": "userid"
  }
}
{
  "id": "api.group.list",
  "ts": "2020-12-02 12:57:58:595+0530",
  "ver": "v1",
  "params": null,
  "result": {
    "group": [
      {
        "activities": [
          {
            "id": "do_2130548011728240641164",
            "type": "Course"
          },
          {
            "id": "do_21301074192677273611434",
            "type": "Course"
          }
        ],
        "createdBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
        "createdOn": "2020-07-14 15:04:14:075+0530",
        "id": "01460efa-ee58-4c3a-b171-810999128b8c",
        "memberRole": "admin",
        "membershipType": "invite_only",
        "name": "Maths class 2",
        "status": "active",
        "updatedBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
        "updatedOn": "2020-07-17 18:07:53:603+0530"
      },
      {
        "activities": [
          {
            "id": "do_21308363397050368012",
            "type": "Course"
          }
        ],
        "createdBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
        "createdOn": "2020-08-11 10:56:14:680+0530",
        "description": "do_21308363397050368012",
        "id": "1481a7d2-00fb-43d3-915b-5251a328e08c",
        "memberRole": "admin",
        "membershipType": "invite_only",
        "name": "Vk-3.2NestedCourse",
        "responseCode": 200,
        "status": "active",
        "updatedBy": "ab467e6e-1f32-453c-b1d8-c6b5fa6c7b9e",
        "updatedOn": "2020-08-11 10:57:13:052+0530"
      }
    ]
  }
}

Delete Group by User

post

This API is used for deleting the groups .

  • The endpoint for Delete Group is /group/v1/delete

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

Authorizations
Header parameters
AuthorizationstringRequired

To make use of any Group 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.

x-authenticated-user-tokenstringRequired

It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password

x-authenticated-forstringOptional

Managed User token of registered MUA user performing given API request. From this LUA and MUA id are seperated and LUA is validated against user_id in x-authenticated-user-token

tsstringOptional

Timestamp is a sequence of characters or encoded information identifying when the list group API call occurred, usually it gives date and time of day, mostly accurate to a small fraction of a second.

X-msgidstringOptional

This ID uniquely identifies a request if the same API is executed multiple times.

Body
Responses
200
OK ! Successful operation."Delete Group" operation was successfully executed.
application/json
Responseall of

Delete response for a Group API

400
BAD REQUEST. The "Delete Group" operation failed ! The possible reason for failure is that you may have missed providing input for a mandatory parameter.
application/json
401
Unauthorized User
application/json
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/group/v1/delete HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
x-authenticated-user-token: text
Content-Type: application/json
Accept: */*
Content-Length: 62

{
  "request": {
    "groupId": "6da747d8-c19f-40cb-9938-fcf0913e301f"
  }
}
{
  "id": "api.group.delete",
  "ver": null,
  "ts": "2020-12-02 11:09:52:748+0530",
  "params": null,
  "result": {
    "response": "SUCCESS"
  },
  "responseCode": 200
}