Single Sourcing - Contribution reusability

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:

Â