Single Sourcing - Contribution reusability
- Kartheek Palla
This wiki explains how we can leverage Open-saber APIs for contribution reuse in single sourcing.
Program_Collection_Map Schema:
Columns | DataType | Values |
programId | varchar | Â |
collectionId | varchar | Â |
collectionInfo | json | name, board, gradeLevel, medium, subject, chapterCount |
primaryCategory | varchar | Â |
hierarchyInfo | array | Â |
status | enum | Active, inActive |
osCreatedAt | varchar | Â |
createdBy | time without time zone | Â |
osUpdatedAt | varchar | Â |
updatedBy | time without time zone | Â |
Contribution_Info Schema:
Columns | DataType | Values |
ContributionId | varchar | Â |
programId | varchar | Â |
contentId | varchar | Â |
collectionId | varchar | Â |
unitId | varchar | Â |
hierarchyInfo | array | Â |
status | enum | Draft, Submitted, Approved, Rejected, RequestChanges |
publishComment | text | Â |
rejectComment | text | Â |
requestChanges | text | Â |
createdBy | varchar | Â |
osCreatedAt | time without time zone | Â |
updatedOn | varchar | Â |
osUpdatedAt | time without time zone | Â |
Review_Info Schema:
Columns | DataType | Values |
id | varchar | Â |
ContributionId | varchar | foreign key |
userId | varchar | Â |
userName | varchar | Â |
organizationId | varchar | Â |
organizationName | varchar | Â |
status | enum | Pending, Accepted, NotAccepted, SentForCorrections |
publishComment | text | Â |
rejectComment | text | Â |
requestChanges | text | Â |
createdBy | varchar | Â |
osCreatedAt | time without time zone | Â |
updatedOn | varchar | Â |
osUpdatedAt | time without time zone | Â |
Â
API Spec:
Â
Create program_collection mapping entry:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/collection/create
Request Header: Authorization: <api-key>
Request Payload:
{
"id": "open-saber.registry.create",
"ver": "1.0",
"ets": "11234",
"params": {
"did": "",
"key": "",
"msgid": ""
},
"request": {
"Program_Collection_Map": {
"program_id": "9ee6e230-49bd-11eb-aae1-fb99d9fb6737",
"collection_id": "do_123456",
"collection_info": {
"name": "English - I",
"board": "CBSE",
"gradeLvel": [
"Class 1"
],
"subject": [
"English"
],
"medium": [
"English"
],
"chapterCount": 4
},
"primary_category": "Digital Textbook",
"hierarchy_info": [
"do_11316452299618713611218",
"do_11316452299638374411248",
"do_11316452299614617611212",
"do_11316452299605606411198"
],
"status": "Active",
"createdBy": "1d866fdf-a664-48c1-9fa8-1222c1cb47ad"
}
}
}
Response:
{
"id": "open-saber.registry.create",
"ver": "1.0",
"ets": 1612197779279,
"params": {
"resmsgid": "",
"msgid": "606a7c96-1343-4e1c-9a61-f9cde6e676d8",
"err": "",
"status": "SUCCESSFUL",
"errmsg": ""
},
"responseCode": "OK"
}
Â
Update program_collection mapping :
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/collection/update
Request Header: Authorization: <api-key>
Request Payload:
{
"id": "open-saber.registry.update",
"ver": "1.0",
"ets": "11234",
"params": {
"did": "",
"key": "",
"msgid": ""
},
"request": {
"Program_Collection_Map": {
"program_id": "9ee6e230-49bd-11eb-aae1-fb99d9fb6737",
"collection_id": "do_123456",
"collection_info": {
"name": "English - I",
"board": "CBSE",
"gradeLvel": [
"Class 1"
],
"subject": [
"English"
],
"medium": [
"English"
],
"chapterCount": 5
},
"hierarchy_info": [
"do_11316452299618713611218",
"do_11316452299638374411248",
"do_11316452299614617611212",
"do_11316452299605606411198",
"do_11316452299605606411211"
],
"updatedBy": "1d866fdf-a664-48c1-9fa8-1222c1cb47ad"
}
}
}
Response:
Read program_collection mapping:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/collection/read
Request Header: Authorization: <api-key>
Request Payload:
Response:
Search program_collection mapping:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/collection/search
Request Header: Authorization: <api-key>
Request Payload:
Response:
Â
Create contribution entry:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/contribution/create
Request Payload:
Â
Request Header:Authorization: <api-key>
Response:
Update contribution entry:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/contribution/update
Request Payload:
Request Header:Authorization: <api-key>
Response:
Read contribution:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/contribution/read/:contributionId
Request Payload:
Request Header:Authorization: <api-key>
Response:
Lsi of contributions:
Method: POST
Path: https://dock.sunbirded.org/api/program/v1/contribution/list
Request Payload:
Â
Request Header:Authorization: <api-key>
Response:
Â