📙
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

Organisation Management

PreviousOwnership Transfer APINextLocation Management

Last updated 2 years ago

Was this helpful?

  • POSTCreate a new Organisation
  • POSTRead Organisation details
  • POSTSearch for an Organisation
  • PATCHUpdate particulars of an existing Organisation
  • PATCHOrganisation update status
  • POSTAssign Key to an Organisation

Create a new Organisation

post

This API is for creation of a new Organisation on the Sunbird Platform.

  • The endpoint for Create a new Organisation is /org/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.

X-Authenticated-User-TokenstringRequired

Access token of registered user performing given API request.

AuthorizationstringRequired

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

Body
all ofOptional
Responses
200
OK. Successful operation. The Organisation Create operation was successfully executed.
application/json
Responseall of
and
400
CLIENT_ERROR. The Organisation Create operation failed due to bad request from client. Possible reasons for failure: Organisation name is mandatory. Invalid property . Channel is mandatory for root organisation. Either "organisationId" or "provider" and "externalId" values are required for the operation. Channel value already used by another organisation. Provide different value for channel. "organisationType" and "isTenant" are mandatory. Provide valid "organisationType" values.
application/json
500
'INTERNAL SERVER ERROR. The Organisation Create operation failed due to a server error. Possible reasons for failure: Channel registration failed.'
application/json
post
POST /api/org/v1/create HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
X-Authenticated-User-Token: text
Content-Type: application/json
Accept: */*
Content-Length: 455

{
  "request": {
    "orgName": "Org Name",
    "channel": "Channel",
    "description": "Description",
    "externalId": "ExtId",
    "email": "info@org.org",
    "isSSOEnabled": true,
    "organisationType": "school",
    "orgLocation": [
      {
        "id": "9541f516-4c01-4322-aa06-4062687a0ce5",
        "type": "block"
      },
      {
        "id": "6dd69f1c-ba40-4b3b-8981-4fb6813c5e71",
        "type": "district"
      },
      {
        "id": "e9207c22-41cf-4a0d-81fb-1fbe3e34ae24",
        "type": "cluster"
      },
      {
        "id": "ccc7be29-8e40-4d0a-915b-26ec9228ac4a",
        "type": "state"
      }
    ],
    "isTenant": true
  }
}
{
  "id": "api.org.create",
  "ver": "v1",
  "ets": 1,
  "params": {
    "resmsgid": null,
    "msgid": "5398bdd7-f80d-4a9e-9c13-90ae3c6bbcb0",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "ts": "2020-11-23 10:03:39:935+0000",
  "result": {
    "organisationId": 131636612466278400,
    "response": "SUCCESS"
  }
}

Read Organisation details

post

This API is for viewing details of an existing Organisation on the Sunbird Platform.

  • The endpoint for Read Organisation details is /org/v1/read
  • 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

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

Body
all ofOptional
Responses
200
OK. Successful operation. The requested operation was successfully executed.
application/json
Responseall of
400
'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: Either "organisationId" or "provider" and "externalId" values are required for the operation.'
application/json
404
'RESOURCE_NOT_FOUND. The requested operation failed as given resource is not existing on server. Possible reasons for failure: organisationId is mandatory.'
application/json
500
'INTERNAL SERVER ERROR. The requested operation failed due to a server error.'
application/json
post
POST /api/org/v1/read HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "request": {
    "organisationId": "0131630445447741440"
  }
}
{
  "result": {
    "id": "api.org.read",
    "ver": "v1",
    "ts": "2020-11-23 10:03:39:935+0000",
    "params": {
      "resmsgid": null,
      "msgid": "5398bdd7-f80d-4a9e-9c13-90ae3c6bbcb0",
      "err": null,
      "status": "success",
      "errmsg": null
    },
    "responseCode": "OK",
    "result": {
      "dateTime": null,
      "preferredLanguage": null,
      "keys": {},
      "channel\"": "ChannelNew",
      "approvedBy": null,
      "description": "Updated Description",
      "updatedDate": "2020-12-01 10:29:49:496+0000",
      "addressId": "0131630420489011201",
      "provider": "channelnew",
      "orgCode": null,
      "locationId": null,
      "theme": null,
      "id": "0131630445447741440",
      "isApproved": null,
      "communityId": null,
      "slug": "channelnew",
      "email": "info@org.org",
      "isSSOEnabled": false,
      "identifier": "0131630445447741440",
      "thumbnail": null,
      "updatedBy\"": null,
      "orgName": "Org Name",
      "address": {},
      "externalId": "extid",
      "rootOrgId": "0131630445447741440",
      "imgUrl": null,
      "approvedDate": null,
      "homeUrl": null,
      "isDefault": null,
      "createdDate": "2020-12-01 09:52:46:962+0000",
      "createdBy": null,
      "hashTagId": "0131630445447741440",
      "noOfMembers": null,
      "status": 0,
      "orgLocation": [
        {
          "id": "9541f516-4c01-4322-aa06-4062687a0ce5",
          "type": "block"
        },
        {
          "id": "6dd69f1c-ba40-4b3b-8981-4fb6813c5e71",
          "type": "district"
        },
        {
          "id": "e9207c22-41cf-4a0d-81fb-1fbe3e34ae24",
          "type": "cluster"
        },
        {
          "id": "ccc7be29-8e40-4d0a-915b-26ec9228ac4a",
          "type": "state"
        }
      ],
      "isTenant": true,
      "isSchool": true,
      "organisationType": 2
    }
  }
}

Search for an Organisation

post

This API is for searching for Organisations on the Sunbird Platform.

  • The endpoint for Search for an Organisation is /org/v1/search
  • 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.

X-Authenticated-User-TokenstringRequired

Access token of registered user performing given API request.

AuthorizationstringRequired

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

Body
all ofOptional
Responses
200
OK. Successful operation. The requested operation was successfully executed.
application/json
400
'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: Either "organisationId" or "provider" and "externalId" values are required for the operation.'
application/json
500
'INTERNAL SERVER ERROR. The requested operation failed due to a server error.'
application/json
post
POST /api/org/v1/search HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
X-Authenticated-User-Token: text
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "request": {
    "filters": {
      "id": "0131630445447741440"
    }
  }
}
{
  "id": "api.org.search",
  "ver": "v1",
  "ts": "2020-11-23 09:16:58:628+0000",
  "params": {
    "resmsgid": null,
    "msgid": "ad7135b8-ef64-44bd-adaa-0b131a657689",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "response": {
      "count": 1,
      "content": [
        {
          "dateTime": null,
          "preferredLanguage": null,
          "keys": {},
          "channel\"": "ChannelNew",
          "approvedBy": null,
          "description": "Updated Description",
          "updatedDate": "2020-12-01 10:29:49:496+0000",
          "addressId": "0131630420489011201",
          "provider": "channelnew",
          "orgCode": null,
          "locationId": null,
          "theme": null,
          "id": "0131630445447741440",
          "isApproved": null,
          "communityId": null,
          "slug": "channelnew",
          "email": "info@org.org",
          "isSSOEnabled": false,
          "identifier": "0131630445447741440",
          "thumbnail": null,
          "updatedBy\"": null,
          "orgName": "Org Name",
          "address": {},
          "externalId": "extid",
          "rootOrgId": "0131630445447741440",
          "imgUrl": null,
          "approvedDate": null,
          "homeUrl": null,
          "isDefault": null,
          "createdDate": "2020-12-01 09:52:46:962+0000",
          "createdBy": null,
          "hashTagId": "0131630445447741440",
          "noOfMembers": null,
          "status": 0,
          "orgLocation": [
            {
              "id": "9541f516-4c01-4322-aa06-4062687a0ce5",
              "type": "block"
            },
            {
              "id": "6dd69f1c-ba40-4b3b-8981-4fb6813c5e71",
              "type": "district"
            },
            {
              "id": "e9207c22-41cf-4a0d-81fb-1fbe3e34ae24",
              "type": "cluster"
            },
            {
              "id": "ccc7be29-8e40-4d0a-915b-26ec9228ac4a",
              "type": "state"
            }
          ],
          "organisationType": 2,
          "isSchool": true,
          "isTenant": true
        }
      ]
    }
  }
}

Update particulars of an existing Organisation

patch

This API is for updating details of an existing Organisation on the Sunbird Platform.

  • The endpoint for Update particulars of an existing Organisation is /org/v1/update
  • 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.

X-Authenticated-User-TokenstringRequired

Access token of registered user performing given API request.

AuthorizationstringRequired

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

Body
all ofOptional
Responses
200
OK. Successful operation. The requested operation was successfully executed.
application/json
Responseall of
and
400
'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: Either "organisationId" or "provider" and "externalId" values are required for the operation.'
application/json
500
'INTERNAL SERVER ERROR. The requested operation failed due to a server error. Possible reasons for failure: Channel registration failed.'
application/json
patch
PATCH /api/org/v1/update HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
X-Authenticated-User-Token: text
Content-Type: application/json
Accept: */*
Content-Length: 385

{
  "request": {
    "organisationId": "0131630445447741440,",
    "description": "updated description,",
    "orgName": "Updated Org Name,",
    "orgLocation": [
      {
        "id": "9541f516-4c01-4322-aa06-4062687a0ce5",
        "type": "block"
      },
      {
        "id": "6dd69f1c-ba40-4b3b-8981-4fb6813c5e71",
        "type": "district"
      },
      {
        "id": "e9207c22-41cf-4a0d-81fb-1fbe3e34ae24",
        "type": "cluster"
      },
      {
        "id": "ccc7be29-8e40-4d0a-915b-26ec9228ac4a",
        "type": "state"
      }
    ]
  }
}
{
  "id": "api.org.status.update",
  "ver": "v1",
  "ets": 1,
  "params": {
    "resmsgid": null,
    "msgid": "5398bdd7-f80d-4a9e-9c13-90ae3c6bbcb0",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "ts": "2020-11-23 10:03:39:935+0000",
  "result": {
    "organisationId": 131636612466278400,
    "response": "SUCCESS"
  }
}

Organisation update status

patch

This API is for updating status of an existing Organisation on the Sunbird Platform.

  • The endpoint for Organisation update status is /org/v1/status/update
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
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.

X-Authenticated-User-TokenstringRequired

Access token of registered user performing given API request.

AuthorizationstringRequired

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

Body
all ofOptional
Responses
200
OK. Successful operation. The requested operation was successfully executed.
application/json
Responseall of
and
400
'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: Either "organisationId" or "provider" and "externalId" values are required for the operation.'
application/json
500
'INTERNAL SERVER ERROR. The requested operation failed due to a server error. Possible reasons for failure: Channel registration failed.'
application/json
patch
PATCH /api/org/v1/status/update HTTP/1.1
Host: staging.sunbirded.org
X-Authenticated-User-Token: text
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 75

{
  "request": {
    "filters": {
      "organisationId": "0131630445447741440",
      "status": 0
    }
  }
}
{
  "id": "api.org.status.update",
  "ver": "v1",
  "ets": 1,
  "params": {
    "resmsgid": null,
    "msgid": "5398bdd7-f80d-4a9e-9c13-90ae3c6bbcb0",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "ts": "2020-11-23 10:03:39:935+0000",
  "result": {
    "organisationId": 131636612466278400,
    "response": "SUCCESS"
  }
}

Assign Key to an Organisation

post

This API is for creation/addition of keys to an Organisation

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.

X-Authenticated-User-TokenstringRequired

Access token of registered user performing given API request.

AuthorizationstringRequired

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

Body
all ofOptional
Responses
200
OK. Successful operation. The Assign key to an Organisation operation was successfully executed.
application/json
Responseall of
and
400
'CLIENT_ERROR. The requested operation failed due to bad request from client. Possible reasons for failure: signKey is mandatory.'
application/json
500
'INTERNAL SERVER ERROR. The requested operation failed due to a server error.'
application/json
post
POST /api/org/v1/assign/key HTTP/1.1
Host: staging.sunbirded.org
Authorization: text
X-Authenticated-User-Token: text
Content-Type: application/json
Accept: */*
Content-Length: 85

{
  "request": {
    "id": "0131630445447741440",
    "signKeys": [
      "S1",
      "S2"
    ],
    "encKeys": [
      "E1",
      "E2"
    ]
  }
}
{
  "id": "api.org.assign.key",
  "ver": "v1",
  "ets": 1,
  "params": {
    "resmsgid": null,
    "msgid": "5398bdd7-f80d-4a9e-9c13-90ae3c6bbcb0",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "ts": "2020-11-23 10:03:39:935+0000",
  "result": {
    "response": "SUCCESS"
  }
}