Create Organization
Scenario
A company, XYZ Corp, is a global conglomerate with over ten thousand employees, spread across 5 locations. Employee training and enablement is one of the core values of the organization. To ensure that employees are regularly trained and upskilled, XYZ Corp has decided to use Sunbird for its learning and training solution on 3 topics, namely Life Science, eCommerce and Archeology (Indian, Greek, Mayan). Gita is the XYZ Corp’s Sunbird adminstrator and is tasked with setting this up in XYZCorp’s Sunbird instance.
Taskflow
Gita identifies the request API headers and body fields relevant for her task. She creates three tenant organizations, one for each training topic. She creates three sub-organizations for each sub-topic, under the tenant organization Archeology. Gita comes up with three distinct alphanumeric strings that is used as value of channel, for each of the tenant organization. Then Gita lists all existing channel identifiers to ensure they are not in use in XYZCorp’s Sunbird instance.
Header Parameters
HEADER | TYPE | DESCRIPTION | SAMPLE |
---|---|---|---|
Content-type | String | Mime type of the request | application/json |
Authorization | String | Authorization key received | abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 |
Request Body
Response Body
Example output contains 800+ channels. Partial response body shown for brevity.
In the response body, Gita inspects the value of all tokens called code to ensure that the channel identifier name she’s decided upon, does not already exist. She creates the three tenant organisations, one for each of the topics. The API request parameters and invocation is depicted in the following example:
Header Parameters
HEADER | TYPE | DESCRIPTION | SAMPLE |
---|---|---|---|
Content-type | String | Mime type of the request | application/json |
Authorization | String | Authorization key received | abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 |
x-authenticated-user-token | String | A token that identifies that the caller is authorised to invoke this REST API | eyqtUZ.Y0RU965YATAb3ws4GcJzEWblQPzUVsefMx6QqO73WwEPFDPhG28uK2z6kTcjst4oqVLNY63tUPZphE5pWRjPYQEIOJK-JxRhJ0RsR6DmJCSb3kmS14n4l5FWQBEQ0AE |
Request Body : Tenant org creation
Response Body
Gita comes up with three identifiers for each sub-organisation. These identifiers are unique across the organisation Archeology and are used as the value of externalID in the request body. She also make a note of the organisationId of the Archaeology tenant organisation, which is used as the value of provider in the request body. Gita provides appropriate values in the request body and invoke the organisation create API, for all three topics (Life Science, eCommerce, Archaeology). Upon each successful outcome, she makes a note of the value of organisationId of each sub-organisation respectively. The API request parameters and invocation are depicted in the following example:
Header Parameters
HEADER | TYPE | DESCRIPTION | SAMPLE |
---|---|---|---|
Content-type | String | Mime type of the request | application/json |
Authorization | String | Authorization key received | abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 |
x-authenticated-user-token | String | A token that identifies that the caller is authorized to invoke this REST API | eyqtUZ.Y0RU965YATAb3ws4GcJzEWblQPzUVsefMx6QqO73WwEPFDPhG28uK2z6kTcjst4oqVLNY63tUPZphE5pWRjPYQEIOJK-JxRhJ0RsR6DmJCSb3kmS14n4l5FWQBEQ0AE |
Request Body : Request for sub-org creation
Response Body
On successfully creating an organisation, the next step is to create users and assign roles to the users within the newly created organisation and sub-organisations.
Concepts Covered
Organisation: It is an conceptual representation of a collection, like institute or a body of individuals.
Channel: Unique identification number associated with a tenant organisation. No two channels can be the same, across any Sunbird instance.
Tenant Organisation: A tenant in any Sunbird instance. Multiple tenant organisations can co-exist in a Sunbird instance.
Sub Organisation: A subordinate level organisations inside a tenant organisation
Last updated