Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction:

This wiki give the details about Viewer Service API(s) Spec design details.

Base Request Spec:

API of type post will follow below request structure

...

Introduction:

This wiki give the details about Viewer Service API(s) Spec design details.

Base Request Spec:

  • Authorization and x-authenticated-user-token are mandatory headers in every request

  • UserId will be captured using the user-token from headers for all api requests

Code Block
languagejson
{
    "id": "api.view", // required. id of the api request
    "ver": "1.0",  // required. Current version of api 
    "ts": "2021-01-01T00:00:00+05:30", //mandatory. Timestamp of the request
    "params": {
        "msgid": "4f04da60-1e24-4d31-aa7b-1daf91c46341" // unique request message id, UUID
    },
    "request": {                  // required
        ....
        ....                            
    }       
    

API Spec

Content View Start

Expand
titlePOST - /v1/view/start

Request Spec:

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    },
    "request": {
        "contentId": "{{contentId}}", // required
        "collectionId" : "{{collectionId}}" // optional
        "contextId": "{{batchId}}" // optional
    }
}

Sample Requests:

Sample1: consume organic content

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:50:175+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
      "contentId" : "content_123"
  }

Sample2: consume content through collection

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
      "contentId" : "content_123"
      "collectionId" : "collection_123"      
    }

Sample3: consume content through context

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
      "contentId" : "content_123",
      "contextId" : "context_123"   
    }

Response:

200 Ok Response:

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "{{contentId}}": "Progress started"
    }
}

4XX or 5XX Error Response:

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072440d-916e-da787881b1b9",
        "err": ERR_Error_Code,
        "status": "failed",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST"/"SERVER_ERROR",
    "result": {
      // error message
    }
}

Sample Response:

Sample1: Valid Request

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "content_123": "Progress started"
    }
}

Sample2: InValid Request

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
         "err": "CLIENT_ERROR",
        "status": "FAILED",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST",
    "result": {
        "request.contentId": "Content Id cannot be empty"
    }
}

Sample3: Invalid ContextId in Request

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
         "err": "CLIENT_ERROR",
        "status": "FAILED",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST",
    "result": {
        "request.contextId": "Invalid Context Id"
    }
}

Content View Update

Expand
titlePOST - /v1/view/update

Request:

Code Block
languagejson
{
    "id": "api.view.update",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
        "contentId": "{{contentId}}",        // required   
        "collectionId" : "{{collectionId}}", //optional
        "contextId": "{{batchId}}",          // optional
        "progressDetails": {                 // required. Progress details specific 
         ...                                      for each mimetype 
         ...                                           
"msgid":
 
"4f04da60-1e24-4d31-aa7b-1daf91c46341"
 
//
 
unique

request
 
message
 
id,
 
UUID
     },
      
request
  "timeSpent" : {{timeSpent}}          // 
request
required
data
    }
}

API Spec

Content View Start

Expand
titlePOST - /v1/view/start
Request Spec:

Sample Requests:

Sample1: Without Context

Code Block
languagejson
{
    "id": "api.view.startupdate",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
      "contentId" : "content_123",
      "progressDetails" : {
         "mimetype" : "appliation/pdf",
         "msgidprogress" : "5e763bc2-b072-440d-916e-da787881b1b9" 20
       }
       "requesttimespent" : {
10
}

Sample1: With Context

Code Block
languagejson
{
       "userIdid": "{{userId}}api.view.update",
   
    "contentIdver": "{{contentId}}v1",
        "collectionIdts" : "{{collectionId}}"  // optional2021-06-23 05:37:40:575+0000",
    "params": {
        "contextIdmsgid": "{{batchId}}" // optional 
5e763bc2-b072-440d-916e-da787881b1b9"
    }
   }
}

Sample Requests:

Sample1:

Code Block
languagejson
SampleRequest1 "request": {
      "idcontentId" : "api.view.startcontent_123",
      "vercollectionId" : "v1collection_123",
      "tscontextId" : "2021-06-23 05:37:50:175+0000context_123",
      "paramsprogressDetails" : {
         "msgidmimetype" : "5e763bc2-b072-440d-916e-da787881b1b9"application/pdf",
    }     "requestprogress" : {20
      "userId" : "user_123",
}
      "contentIdtimespent" : "content_123"
    10
}

Sample2Response:

Code Block
languagejson
200 OK:
{
    "id": "api.view.startupdate",
    "ver": "v1",
    "ts": "2021-06-23 05contents05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    }     "requesterr": {null,
      "userId" : "user_123",
      "contentId" status": "content_123success",
      "collectionId" : "collection_123"     "errmsg": null
    }

Sample3:

Code Block
{,
    "idresponseCode": "api.view.startOK",
    "verresult": "v1", {
        "ts{{contentId}}": "2021-06-23 05:37:40:575+0000",Progress Updated"
    }
 "params": {
  }

4XX or 5XX Error:
{
    "msgidid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }api.view.update",
      "requestver": {
 "v1",
    "userIdts" : "user_123",
 2021-06-23 05:37:40:575+0000",
    "contentIdparams": {
: "content_123",       "collectionIdresmsgid" : "collection_123"null,
        "contextIdmsgid" : "context_123"5e763bc2-b072-440d-916e-da787881b1b9",
        "err":  }

Response:

200 Ok Response:

Code Block
languagejson
{ERR_Error_Code,
        "idstatus": "api.view.startfailed",
        "vererrmsg": "v1" ERR_error_msg
    },
    "tsresponseCode": "2021-06-23 05:37:40:575+0000BAD_REQUEST"/"SERVER_ERROR",
    "paramsresult": {
        "resmsgid": null,
 }
}

Content View End

Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{
       "msgidid": "5e763bc2-b072-440d-916e-da787881b1b9",
   api.view.end",
    "errver": null,
   "v1",
    "statusts": "success2021-06-23 05:37:40:575+0000",
 
      "errmsgparams": null
 {
  },     "responseCodemsgid": "OK",5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "resultrequest": {
        "contentId": "{{contentId}}": "Progress started"          //required.
 }
}

4XX or 5XX Error:

Code Block
languagejson
{       "idcollectionId" : "api.view.start{{collectionId}}",  // required.only when 
 "ver": "v1",     "ts": "2021-06-23 05:37:40:575+0000",     "params": {         "resmsgid": null,         "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",         "err": ERR_Error_Code,      contextId present in "status": "failed",request 
        "errmsgcontextId": ERR_error_msg
    }"{{batchId}}",     "responseCode": "BAD_REQUEST"/"SERVER_ERROR",     "result": {// optional
    }
}

Sample

Response

Request:

Sample1: Without Context

Code Block
languagejson
{
    "id": "api.view.startend",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       
"resmsgid": null,         "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",}
    "resultrequest": {
      "contentId" : "content_123":
"Progress started"     }
}

Sample2: With Context

Code Block
languagejson
{
    "id": "api.view.startend",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid":
null,         "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    }
    "errrequest": "CLIENT_ERROR",{
        "statuscontentId" : "failedcontent_123",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST",     "resultcollectionId" : {"collection_123",
        "request.contentIdcontextId" : "Contentcontext_123" Id cannot be
empty"     }
}

Content View Update

Expand
titlePOST - /v1/view/update
Request
}

Response:

Code Block
languagejson
{
    "id": "api.view.updateend",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
 
     "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request"resmsgid": {null,
        "userIdmsgid": "{{userId}}5e763bc2-b072-440d-916e-da787881b1b9",
           // mandatory   "err": null,
        "contentIdstatus": "{{contentId}}success",
     // mandatory  "errmsg": null
    },
    "collectionIdresponseCode" : "{{collectionId}}OK",
//optional
    "result": {
       "contextId": "{{batchIdcontentId}}": ",Progress ended"
    }
}

Content View Read

Expand
titlePOST - /v1/view/read

Request:

Code Block
languagejson
{
     // optional"id": "api.view.read",
    "ver": "v1",
    "progressDetailsts": {} "2021-06-23 05:37:40:575+0000",
    "params": {
  // mandatory. Progress details specific "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
        "contentId": {{contentId}}, //required
        "collectionId" : "{{collectionId}}", //optional 
             "contextId": "{{batchId}}"     for each mimetype// optional
     }
}

Sample RequestResponse:

Code Block
languagejson
{
    "id": "api.view.updateread",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": {null
    },
    "msgidresponseCode": "5e763bc2-b072-440d-916e-da787881b1b9"OK",
    }"result": {
      "requestuserId" : "{{userId}}",
      "userIdcontentId" : "user_123{{contentId}}",
      "contentIdtype" : "content_123","
      contents:[{
    	"collectionId" : "collection_123{{collectionId}}",
      	"contextId" : "context_123{{batchId}}",  
        "progressDetailscontentId" : "{{contentId}}",
         "mimetypestatus" : "appliation/pdf",{{content_status}}"  
        "progressprogressDetails" : 20,"{}"
        }]
"timespent" : 10   }
    }
}

Sample Response:

Sample1: Without context(organic consumption)

json
Code Block
language
200 OK:
{
    "id": "api.view.updateread",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    }",
    "responseCode": "OK",     "resulterr": {null,
        "{{contentId}}status": "Progress Updatedsuccess",
    } }  4XX or 5XX Error "errmsg": {null
    "id": "api.view.update"},
    "verresponseCode": "v1OK",
    "tsresult": "2021-06-23 05:37:40:575+0000",{
     	"paramsuserId": {"user_123"
        "resmsgidcontentId": null"content_123",
        "msgidtype": "5e763bc2-b072-440d-916e-da787881b1b9", "content"
        "errcontents": ERR_Error_Code,[{
           "statuscontentid" : "failedcontent_123",
           "errmsgcollectionid" : ERR_error_msg"content_123",
      },     "responseCodecontenxtid" : "BADcontent_REQUEST"/"SERVER_ERROR",123"
           "resultstatus" : {"1",
     } }

Content View End

{
Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{     "idprogressDetails": "api.view.end", {
             "vermimeType" : "v1",application/video"
              "tsprogress" : "2021-06-23 05:37:40:575+0000",
    "params": {20
            }
        }]
  "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    } }
}

Example2: With context or collection

Code Block
languagejson
{
    "requestid": {"api.view.read",
        "userIdver": "{{userId}}v1",
    "ts": "2021-06-23 05:37:40:575+0000",
      //mandatory"params": {
        "contentIdresmsgid": "{{contentId}}"null,
         //mandatory
  "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
     "collectionId" : "{{collectionId}}",  // optional"err": null,
        "contextIdstatus": "{{batchId}}success",
          // optional"errmsg": null
     }
}

Sample Request:

Code Block
languagejson
{},
    "idresponseCode": "api.view.endOK",
    "verresult": "v1",{
    	"tsuserId": "2021-06-23 05:37:40:575+0000","user_123"
        "paramscontentId": {"content_123",
        "msgidtype": "5e763bc2-b072-440d-916e-da787881b1b9"
content"
   }     "requestcontents":[{
    {       "userIdcontentid" : "usercontent_123",
           "contentIdcollectionid" : "contentcollection_123",
    }
Code Block
languagejson
       "
id
contenxtid" : "
api.view.end",
context_123"
     
"ver":
 
"v1",
     "
ts
status" : "
2021-06-23 05:37:40:575+0000
1",
    
"params":
 
{
      "
msgid
progressDetails": 
"5e763bc2-b072-440d-916e-da787881b1b9"
{
    
}
 
"request":
 
{
       "
userId
mimeType" : "
user_123",
application/video"
            
"contentId"
 
:
 "
content_123
progress"
,
 :20
     
"collectionId"
 
:
 
"collection_123",
     }
 
"contextId"
 
:
 
"context_123",
     }]
    }
}
Response
Expand
titlePOST - /v1/view/read?context=all

Request:

Code Block
languagejson
{
    "id": "api.view.endread.contextall",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
 
    }
    "request": {       "err": null,         "status": "success",    // either of the three "errmsg": null
options is mandatory
   },     "responseCodecontentId": "OK",{{contentId}}" //optional
        "resultcollectionId" : "{{collectionId}}", //optional
        "contextId" : "{{contentIdcontextId}}": "Progress ended"//optional
     }
}

Content View Read

Expand
titlePOST - /v1/view/read
Request

Response:

Code Block
languagejson
{
    "id": "api.view.read.contextall",
 
  "ver": "v1",
 
  "ts": "2021-06-23 05:37:40:575+0000",
 
  "params": {
    "resmsgid": null,
    "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    ...
    ...                          "request": {    //requested_data
    "userIdtype": "{{userId}}contextall",
    "contents" : [    "contentIds": ["{{contentId_1}}", "{{contentId_2}}"],             "collectionId" : "{{collectionId}}", //optional
 List of all contents irresepcitvie of context
     ]
 "contextId": "{{batchId}}"  }      // optional     
}
}

Sample Response:

Code Block
languagejson
{
    "id": "api.view.read.contextall",

   "ver": "v1",
 
  "ts": "2021-06-23 05:37:40:575+0000",
 
  "params": {
   
    "resmsgid": null,
  
     "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    "err": null,
   "err "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
  "statususerId" : "successuser_123",
  "collectionId" : "collection_123"
   "errmsgcontents":[
null    {
 },     "responseCodeuserid" : "OKuser_123",
      "resultcontentId": { "content_123",
      	"userIdstatus": "{{userId}}1",
    	  "collectionIdprogressDetails": "{{collectionId}}", // optional{
        	"contextIdprogress": "{{batchId}}"20,
 // optional         "contentstimespent": [{10
      }
   "identifier": "{contentId}",
    {
      "progressDetailsuserid" : "{}user_123",
    	  "scorecollectionId": {{best_score}}"collection_!23",
    	  "max_scorecontextId": {{max_score}}"context_123",
      "contentId": "content_123",
    }]  "progressDetails": {
 } } 

Sample Response:

Example1:

Code Block
{     "idprogress": "api.view.read"20,
        "vertimespent": "v1",10
    "ts": "2021-06-23 05:37:40:575+0000", },
      "paramsstatus": {"2"
    }
  ]
  "resmsgid": null,
   }
}

Content Submit Assess

Expand
titlePOST - /v1/assessment/submit

Request:

Code Block
languagejson
{
    "msgidid": "5e763bc2-b072-440d-916e-da787881b1b9api.assess.submit",

       "errver": null"v1",
        "statusts": "success2021-06-23 05:37:40:575+0000",
   
    "errmsgparams": null{
    },     "responseCodemsgid": "OK",5e763bc2-b072-440d-916e-da787881b1b9"
    "result": {
    	"userId": "user_123",}     
    "contentsrequest": [{
 
        "contentId": "content_123{{contentId}}",         // required "progressDetails": "{
        "collectionId"  :   "progress" :20"{{collectionId}}",  // required
        "contextId":  "timespent" : 10{{batchId}}",           // required 
 }",     	  "scoreattemptId" : 5"{{attemptId}}",     	  "max_score": 10
 // required
       }]
    }
}

Example2:

Code Block
languagejson
 "assessments": [{
    "id": "api.view.read",     "ver": "v1",
 {{assess_event}}    "ts": "2021-06-23 05:37:40:575+0000",
    "params": { // required for self-assess contents
        }]
 "resmsgid": null,  }
}

Response:

Code Block
{
     "msgidid": "5e763bc2-b072-440d-916e-da787881b1b9api.view.assess",
        "errver": null,
  "v1",
     "statusts": "success2021-06-23 05:37:40:575+0000",
  
     "errmsgparams": null{
    },     "responseCoderesmsgid": "OK"null,

   "result": {     	"userIdmsgid": "user_1235e763bc2-b072-440d-916e-da787881b1b9",
        "collectionIderr" : "collection_!23"null,
        "contextIdstatus" : "context_123success",
        "contentserrmsg": [{null
    },
     "contentIdresponseCode": "content_123OK",
   
      "progressDetails": "{
   result": {
         "progress{{contentId}}" :20, "Score Updated"
    }
}

Content Assesment Read

Expand
titlePOST - /v1/assessment/read
Expand
titlePOST - /v1/assessment/submit

Request:

Code Block
languagejson
{
    "timespentrequest" : 10{
        "contentId" : "{{contentId}}",     	//required
        "scorecollectionId" : 5"{{collectionId}}", //required
   	     "max_scorecontextId": 10
    "{{batchId}}"   // }]required
    }
}

Content Submit Assess

RequestResponse:

Code Block
languagejson
{
    "id": "api.assessassessment.submitread",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "requestresult": {
        	"userId": "{{userId}}",
        "contentId" : "{{contentId}}"
   // mandatory  	"collectionId": "{{collectionId}}",
         "contentId	"contextId": "{{contentIdbatchId}}",
        // mandatory"assessments": [{
          "collectionIdattemptId" : "{{collectionIdattemptId}}",
 // mandatory  	  "score": {{score}},
   "contextId 	  "max_score": "{{batchIdmax_score}}",
          // mandatory},{
          "attemptId" : "{{attemptId}}",        //mandatory,
     	   "assessmentsscore": [{{score}},
    	        "max_score": {{assessmax_eventscore}}
     // mandatory for self-assess contents}
        }]
    }
}

Viewer Summary - All enrolments

Expand
titleGET - /v1/summary/list/:userId

Response:

Code Block
languagejson
{
    "id": "api.viewsummary.assesslist",
    "ver": "v1",
    "ts": "2021-06-23 05:3759:4054:575984+0000",

   "params": {
        "resmsgid": null,
  
     "msgid": "5e763bc295e4942d-b072cbe8-440d477d-916eaebd-da787881b1b9ad8e6de4bfc8",
   
    "err": null,
  
     "status": "success",
   
    "errmsg": null
 
  },
    "responseCode": "OK",
  "result": {
    "resultsummary": [
      {
        "userId": "{{contentIduserId}}",
        "collectionId": "SUCCESS"{{collectionId}}",
      } }

Content Assesment Read

Expand
titlePOST - /v1/assessment/read

Request:

Code Block
languagejson
{ "contextId": "{{batchId}}",
        "requestenrolledDate": {1624275377301,
        "userIdactive": "{{userId}}"true,
        "contentIdcontentStatus": ["do_123", "do_1234"],{
          "collectionId{{contentId}}" : "{{collectionId}}", //optionalstatus}}
        },
        "contextIdassessmentStatus": "{{batchId}}"{
    // optional    }
}

Response:

Code Block
languagejson
 "assessmentId": {
    "id": "api.assessment.read",        "verscore": "v1"{{best_score}},
    "ts": "2021-06-23 05:37:40:575+0000",        "paramsmax_score": {{max_score}}
        "resmsgid": null, }
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9" },
        "errcollection": {
 null,         "statusidentifier": "success{{collectionId}}",
          "errmsgname": null"{{collectionName}}",
     },     "responseCodelogo": "OK{{logo Url}}",
    "result": {     	"userIdleafNodesCount": "{{userIdleafNodeCount}}",
          "contentIddescription" : "{{contentIddescription}}"
    	"collectionId": "{{collectionId}}"    },
    	"contextId    "issuedCertificates": "{{batchId}}",[{
          "assessmentsname": [{"{{certName}}",
          "attemptIdid" : "{{attemptId}}certificateId",
     	     "scoretoken": "{{scorecertToken}}",
    	      "max_scorelastIssuedOn": "{{max_scorelastIssuedOn}}"
        }],{
        "attemptIdcompletedOn" : "{{attemptIdcompletion_date}}",
    	    "scoreprogress": {{scoreprogress}},
      	  "max_scorestatus": {{max_scorestatus}}
        }
        ]
    }
}

Viewer Summary - All enrolments

Expand
titleGET - /v1/summary/list/:userId
Response

Sample Response:

Sample1:

Code Block
languagejson
{
  "id": "api.summary.list",
  "ver": "v1",
  "ts": "2021-06-23 05:59:54:984+0000",
  "params": {
    "resmsgid": null,
    "msgid": "95e4942d-cbe8-477d-aebd-ad8e6de4bfc8",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "summary": [
      {
        "userId": "{{userId}}user_123",
        "collectionId": "{{collectionId}}collection_123",
        "contextId": "{{batchId}}context_123",
        "enrolledDate": 1624275377301,
        "active": true,
        "contentStatus": {
          "{{contentId}}": {{status}}content_123": 2,
          "content_456": 1
        },
        "assessmentStatus": {
          "assessmentIdcontent_123": {
            "score": {{best_score}},
            "max_score": {{max_score}}
          }
        },
        "collection": {
          "identifier": "{{collectionId}}collection_123",
          "name": "{{collectionName}}Mathematics",
          "logo": "{{logo Url}}http://logoimage",
          "leafNodesCount": {{leafNodeCount}}4,
          "description": "{{description}}Dummy Collection"
        },
        "issuedCertificates": [{
          "name": "{{certName}}Certificate-1",
          "id": "certificateIdcert_123",
          "token": "{{certToken}}sdfjkldjk23j2kj2k3jk2",
          "lastIssuedOn": "{{lastIssuedOn}}1624275377301"
        }],
        "completedOn": {{completion_date}}"2021-09-10",
        "progress": {{progress}}70,
        "status": {{status}}1
      }
    ]
  }
}

Viewer Summary - Specific enrolment

Expand
titlePOST - /v1/summary/read

Request:

Code Block
{
    "request": {
        "userId": "{{userId}}", // required
        "collectionId" : "{{collectionId}}", // required
        "contextId": "{{batchId}}"}" //required
    }
}

Response:

Code Block
languagejson
{
  "id": "api.summary.read",
  "ver": "v1",
  "ts": "2021-06-23 05:59:54:984+0000",
  "params": {
    "resmsgid": null,
    "msgid": "95e4942d-cbe8-477d-aebd-ad8e6de4bfc8",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
        "userId": "{{userId}}",
        "collectionId": "{{collectionId}}",
        "contextId": "{{batchId}}",
        "enrolledDate": 1624275377301,
        "active": true,
        "contentStatus": {
          "{{contentId}}": {{status}}
        },
        "assessmentStatus": {
          "assessmentId": {
            "score": {{best_score}},
            "max_score": {{max_score}}
          }
        },
        "collection": {
          "identifier": "{{collectionId}}",
          "name": "{{collectionName}}",
          "logo": "{{logo Url}}",
          "leafNodesCount": {{leafNodeCount}},
          "description": "{{description}}"
        },
        "issuedCertificates": [{
          "name": "{{certName}}",
          "id": "certificateId",
          "token": "{{certToken}}",
          "lastIssuedOn": "{{lastIssuedOn}}"
        }],
        "completedOn": {{completion_date}},
        "progress": {{progress}},
        "status": {{status}}
  }
}

Viewer Summary DeleteDownload - Default Format : CSV

Expand
titleDELETE GET - /v1/summary/deletedownload/:userId?all - To Delete all enrolments

Response:

Code Block
languagejson
Response: 
{
    "id": "api.summary.deletedownload",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {}
}
Expand
titleDELETE - /v1/summary/delete/:userId - To Delete specific enrolments

Request:

Code Block
{      "requesterrmsg": {null
    },
    "userIdresponseCode": "{{userId}}OK",
        "collectionIdresult" : "{{collectionId}}",
        "contextIdurl": "{{batchIduserId}}_viewer_summary.csv"
    }
}
Expand
titleGET - /v1/summary/download/:userId?format=json

Response:

Code Block
languagejson
Response: 
{
    "id": "api.summary.deletedownload",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",",
    "result": {
      "url": "{{userId}}_viewer_summary.json"
    "result": {}
}

Viewer Summary DownloadDelete

Expand
titleGET DELETE - /v1/summary/downloaddelete/:userId?format=csvall - To Delete all enrolments

Response:

Code Block
languagejson
Response: 
{
    "id": "api.summary.downloaddelete",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "paramsstatus": {"success",
        "resmsgiderrmsg": null,
    },
    "msgidresponseCode": "5e763bc2-b072-440d-916e-da787881b1b9OK",
    "result": {
   "err": null,
     "{{userid}}" : "Enrolment Deleted Succesfully"
    }
}
expandGET - /v1/summary/download/:userId
Expand
titleDELETE - /v1/summary/delete/:userId - To Delete specific enrolments

Request:

Code Block
{
    "statusrequest": "success",{
        "errmsguserId": null
 "{{userId}}",   // required
   },     "responseCodecollectionId" : "OK{{collectionId}}",  // required
 "result": {       "urlcontextId": "{{userIdbatchId}}_viewer_summary.csv"  // required
    }
}

Response:

Code Block
title
languagejson
Response:
Code Block
 
{
    "id": "api.summary.downloaddelete",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {

     "url{{userid}}" : "{{userId}}_viewer_summary.jsonEnrolment Deleted Succesfully"
    }
}

Clarifications:

  • For assessment submit, do we need consider the assess events without context as well