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 Post Request Spec:

...

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": {             
"msgid": "4f04da60-1e24-4d31-aa7b-1daf91c46341"
    // 
unique request message id, UUID
required. Progress details specific 
        
},
 ...    
request:
 
{
         
//
 
request
 
data
     
}
     

API Spec

Content View Start

Expand
titlePOST - /v1/view/start

Request Spec:

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

Sample Requests:

Sample1: consume organic contentWithout Context

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

Sample2: consume content through collectionSample1: With 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": {
      "userIdcontentId" : "usercontent_123",
      "contentIdcollectionId" : "contentcollection_123",
      "collectionIdcontextId" : "collectioncontext_123",
      "progressDetails" : {
         "mimetype" : "application/pdf",
         "progress" : 20
       }
      "timespent" : 10
}

Sample3Response: consume content through context

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,
{        "userIdstatus" : "user_123success",
        "contentIderrmsg": null
 : "content_123",  },
    "collectionIdresponseCode" : "collection_123OK",
    "result": {
 "contextId"        "{{contentId}}": "context_123Progress Updated"
    }
}

4XX or 5XX }

Response:

200 Ok Response:

Code Block
languagejson
Error:
{
    "id": "api.view.startupdate",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": nullERR_Error_Code,
        "status": "successfailed",
        "errmsg": nullERR_error_msg
    },
    "responseCode": "OKBAD_REQUEST"/"SERVER_ERROR",
    "result": {
        "{{contentId}}": "Progress started"
 
  }
}
4XX or 5XX Error Response
}

Content View End

Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{
    "id": "api.view.startend",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
   
    "resmsgidparams": null,
{
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    }
    "errrequest": ERR_Error_Code,{
        "statuscontentId": "failed{{contentId}}",         "errmsg": ERR_error_msg //required.
    },
    "responseCodecollectionId" : "BAD_REQUEST"/"SERVER_ERROR",{{collectionId}}",  // required.only when 
             "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",  contextId present in "params":request {
        "resmsgidcontextId": null,"{{batchId}}",          "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    // optional
    }
}

Sample Request:

Sample1: Without Context

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

Sample2: InValid RequestWith Context

Code Block
languagejson
{
    "id": "api.view.startend",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
  ",
     "resmsgidparams": null,
{
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    }
    "errrequest": "CLIENT_ERROR",{
        "statuscontentId" : "failedcontent_123",
        "errmsgcollectionId": ERR_error_msg
    },
    "responseCode": "BADcollection_REQUEST123",
 
  "result": {         "request.contentId": "Content Id cannot be empty"
    }
}

Content View Update

Expand
titlePOST - /v1/view/update
Request
"contextId" : "context_123"   
    }

Response:

Code Block
languagejson
{
    "id": "api.view.updateend",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
,
   }     "requesterr": {null,
        "userIdstatus": "{{userId}}success",
        "errmsg": null
   // required},
    "responseCode": "OK",
    "contentIdresult": {
        "{{contentId}}", : "Progress ended"
    }
}

Content View Read

/ required
Expand
titlePOST - /v1/
view/read

Request:

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

Response:

Code Block
languagejson
{
    "id": "api.view.read",
   // mandatory. Progress details specific "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
             "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
          for each mimetype
 "status": "success",
  } }

Sample Requests:

Sample1: Without Context

Code Block
languagejson
{     "iderrmsg": "api.view.update",null
    "ver": "v1"},
    "tsresponseCode": "2021-06-23 05:37:40:575+0000OK",
    "paramsresult": {
       "msgiduserId" : "5e763bc2-b072-440d-916e-da787881b1b9"
    }{{userId}}",
      "requestcontentId" : "{{contentId}}",
      "userIdtype" : "user_123",
 content"
      contents:[{
    	"contentIdcollectionId" : "content_123{{collectionId}}",
      	"progressDetailscontextId" : "{{batchId}}",  
        "mimetypecontentId" : "appliation/pdf{{contentId}}",
         "progressstatus" : 20,"{{content_status}}"  
        "timespentprogressDetails": "{}"
:     10   }]
    }
}

Sample Response:

Sample1: With ContextWithout context(organic consumption)

language
Code Block
json
{
    "id": "api.view.updateread",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
      "userId" : "user_123" "resmsgid": null,
      "contentId" : "content_123",
      "collectionId" : "collection_123msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
      "contextId" : "context_123",
      "progressDetails" : {err": null,
         "mimetypestatus" : "application/pdfsuccess",
         "progresserrmsg" : 20,null
    },
    "timespentresponseCode" : 10"OK",
       }
}

Response:

Code Block
languagejson
200 OK:
"result": {
    	"iduserId": "api.view.update",user_123"
        "vercontentId": "v1content_123",
        "tstype": "2021-06-23 05:37:40:575+0000",content"
        "contents":[{
 "params": {         "resmsgidcontentid" : null,"content_123",
           "msgidcollectionid" : "5e763bc2-b072-440d-916e-da787881b1b9","content_123",
           "errcontenxtid" : null,"content_123"
           "status" : "success1",
           "errmsgprogressDetails": {
   null     },     "responseCodemimeType" : "OK",application/video"
              "resultprogress" :20
{            "{{contentId}}": "Progress Updated"}
        }]
}  4XX or 5XX}
Error:
}

Example2: With context or collection

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": ERR_Error_Code,
        "status": "failed",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST"/"SERVER_ERROR",-da787881b1b9",
        "resulterr": {null,
    }
}

Content View End

Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{     "idstatus": "api.view.endsuccess",
        "vererrmsg": "v1" null
    },
    "tsresponseCode": "2021-06-23 05:37:40:575+0000OK",
    "paramsresult": {
       	"msgiduserId": "5e763bc2-b072-440d-916e-da787881b1b9"
user_123"
   }     "requestcontentId": {"content_123",
        "userIdtype": "{{userId}}content",
         "contents":[{
   //mandatory         "contentIdcontentid" : "{{contentId}}"content_123",
         //mandatory.  "collectionid" :"collection_123",
           "collectionIdcontenxtid" : "{{collectionId}}",context_123"
 // optional.mandatory only when       "status" : "1",
           "progressDetails": {
             "mimeType"     : "application/video"
           contextId present in request"progress" :20
        "contextId": "{{batchId}}",   }
       // optional}]
    }
}
Sample
Expand
titlePOST - /v1/view/read?context=all
Expand
titlePOST - /v1/view/read

Request:

Sample1: Without Context

Code Block
languagejson
{
    "id": "api.view.read.endcontextall",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {                      // either of the three options is mandatory
        "requestcontentId": "{{contentId}}" //optional
        "userIdcollectionId" : "user_123{{collectionId}}", //optional
        "contentIdcontextId" : "content_123{{contextId}}" //optional
     }
}

Sample2Response: With Context

Code Block
languagejson
{

   "id": "api.view.endread.contextall",
    "ver": "v1",
 
  "ts": "2021-06-23 05:37:40:575+0000",
 
  "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
  {
    "userIdresmsgid" : "user_123"null,
      "contentIdmsgid" : "content_1235e763bc2-b072-440d-916e-da787881b1b9",
 
    "collectionIderr" : "collection_123"null,
      "contextIdstatus" : "context_123success",
       }

Response:

Code Block
languagejson
{
    "id": "api.view.end""errmsg": null
  },
    "verresponseCode": "v1OK",
    "tsresult": "2021-06-23 05:37:40:575+0000",{
     "params": {...
    ...      "resmsgid": null,         "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",         "err": null,    //requested_data
    "statustype": "successcontextall",
    "contents" : [  "errmsg": null            },     "responseCode": "OK",
    "result": { // List of all contents irresepcitvie of context
     ]
   "{{contentId}}": "Progress ended"}            }
}

Content View Read

RequestSample Response:

Code Block
languagejson
{
 
  "id": "api.view.read.contextall",
 
  "ver": "v1",
 
  "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
        "userId": "{{userId}}",
     
  "contentIdsparams": ["{{contentId_1}}", "{{contentId_2}}"],{
    "resmsgid": null,
    "collectionIdmsgid" : "{{collectionId}}5e763bc2-b072-440d-916e-da787881b1b9",
//optional    "err": null,
    "contextIdstatus": "{{batchId}}"success",
   // optional
 "errmsg": null
  },
 }
}

Response:

Code Block
languagejson
{
  "responseCode": "OK",
  "result": {
  "iduserId" : "api.view.readuser_123",
  "collectionId" : "ver":collection_123"
  "v1",contents":[
    {
      "tsuserid" : "2021-06-23 05:37:40:575+0000"user_123",
      "paramscontentId": {"content_123",
        "resmsgidstatus": null"1",
 
      "msgidprogressDetails": "5e763bc2-b072-440d-916e-da787881b1b9",{
        "errprogress": null20,
        "statustimespent": "success",
  10
     "errmsg": null}
    },
    {
"responseCode": "OK",     "resultuserid" : {"user_123"
      	"userIdcollectionId": "{{userId}}collection_!23",
    	  "collectionIdcontextId": "{{collectionId}}context_123",
// optional     	"contextIdcontentId": "{{batchId}}content_123",
 // optional
        "contentsprogressDetails": [{
 
        "contentIdprogress": "{contentId}",
      20,
   "status" : "{{content_status}}"   // 0,1 or 2 "timespent": 10
      },
      "progressDetailsstatus": "{}2"
    }
   }]

   }
}

Sample Response:

Example1

Content Submit Assess

Expand
titlePOST - /v1/assessment/submit

Request:

Code Block
languagejson
{
    "id": "api.viewassess.readsubmit",
    "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
"request": {
   },     "responseCodecontentId": "OK{{contentId}}",     "result": {   // required 	"userId": "user_123",
        "contentscollectionId" : [{"{{collectionId}}",  // required
        "contentIdcontextId": "content_123{{batchId}}",           "status" : "1",// required 
          "progressDetailsattemptId" : "{{attemptId}}",        // required
    "progress" :20,   "assessments": [{
         "timespent" : 10 {{assess_event}}      // required for self-assess }"contents
        }]
    }
}

Example2Response:

language
Code Block
json
{
    "id": "api.view.readassess",
    "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": {
    	"userId": "user_123",
        "collectionId{{contentId}}" : "collection_!23",
        "contextIdScore Updated"
: "context_123",   }
     "contents": [{
     }

Content Assesment Read

Expand
titlePOST - /v1/assessment/read

Request:

Code Block
languagejson
{
    "contentIdrequest": "content_123",{
          "progressDetailscontentId" : "{
             "progress" :20{{contentId}}",     //required
        "timespentcollectionId" : 10
          "{{collectionId}}", //required
         status "contextId": "1{{batchId}}"   // required
    }]

   }
}

Content Submit Assess

Expand
titlePOST - /v1/assessment/submit
Request

Response:

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
    },
    "requestresponseCode": {"OK",
    "result": {
    	"userId": "{{userId}}",
        "contentId" : "{{contentId}}"
   // mandatory  
   	"collectionId": "{{collectionId}}",
     	"contentIdcontextId": "{{contentIdbatchId}}",
        // mandatory"assessments": [{
          "collectionIdattemptId" : "{{collectionIdattemptId}}",
 // mandatory  	  "score": {{score}},
    	  "contextIdmax_score": "{{batchIdmax_score}}",
          // mandatory},{
          "attemptId" : "{{attemptId}}",
    	   //mandatory
        "assessments"score": [{{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,
    "errstatus": null"success",
    "errmsg": null
  },
  "statusresponseCode": "successOK",
  "result": {
    "summary": [
    "errmsg": null {
   },     "responseCodeuserId": "OK{{userId}}",
        "resultcollectionId": "{{collectionId}}",
        "contextId": "{{contentIdbatchId}}":,
"SUCCESS"     } } 

Content Assesment Read

Expand
titlePOST - /v1/assessment/read

Request:

Code Block
languagejson
{
    "requestenrolledDate": {1624275377301,
        "userIdactive": "{{userId}}"true,
        "contentStatus": {
 //mandatory         "{{contentId}}" : "{{contentIdstatus}}",
        //mandatory},
        "collectionIdassessmentStatus" : "{{collectionId}}", //mandatory{
          "contextIdassessmentId": "{{batchId}}"
  // mandatory    } }

Response:

Code Block
languagejson
{
    "idscore": "api.assessment.read"{{best_score}},
    "ver": "v1",        "ts": "2021-06-23 05:37:40:575+0000",max_score": {{max_score}}
       "params": {  }
      "resmsgid": null  },
        "msgidcollection": "5e763bc2-b072-440d-916e-da787881b1b9", {
          "erridentifier": null"{{collectionId}}",
          "statusname": "success{{collectionName}}",
          "errmsglogo": null"{{logo Url}}",
     },     "responseCodeleafNodesCount": "OK"{{leafNodeCount}},
    "result": {     	"userIddescription": "{{userId}}"description}}"
        },
        "contentIdissuedCertificates" : "{{contentId}}"[{
    	"collectionId": "{{collectionId}}",     	"contextIdname": "{{batchIdcertName}}",
          "assessmentsid": [{"certificateId",
          "attemptIdtoken" : "{{attemptIdcertToken}}",
    	  "score": {{score}},
    	  "max_score"lastIssuedOn": "{{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}}", // mandatoryrequired
        "collectionId" : "{{collectionId}}", // mandatoryrequired
        "contextId": "{{batchId}}" //mandatoryrequired
    }
}

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": {
      "url": "{{userId}}_viewer_summary.csv"
    }
}

Request:

{
Expand
titleDELETE GET - /v1/summary/deletedownload/:userId - To Delete specific enrolments
Code Block
?format=json

Response:

Code Block
languagejson
{
    "id": "api.summary.download",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "requestparams": {
        "userIdresmsgid": "{{userId}}"null,
        "collectionIdmsgid" : "{{collectionId}}5e763bc2-b072-440d-916e-da787881b1b9",
        "contextIderr": "{{batchId}}"null,
    } }

Response:

Code Block
languagejson
Response:  {     "idstatus": "api.summary.deletesuccess",
        "vererrmsg": "v1"null
    },
    "ts": "2021-06-23 05:37:40:575+0000"responseCode": "OK",
    "paramsresult": {
        "resmsgidurl": null,"{{userId}}_viewer_summary.json"
    }
}

Viewer Summary Delete

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

Response:

Code Block
languagejson
Response: 
{
    "msgidid": "5e763bc2-b072-440d-916e-da787881b1b9",
  api.summary.delete",
     "errver": null,
   "v1",
    "statusts": "success2021-06-23 05:37:40:575+0000",
        "errmsgparams": null
{
   },     "responseCoderesmsgid": "OK"null,
    "result": {} } 

Viewer Summary Download

Expand
titleGET - /v1/summary/download/:userId?format=csv

Response:

Code Block
{     "idmsgid": "api.summary.download",5e763bc2-b072-440d-916e-da787881b1b9",
        "vererr": "v1",
  null,
 "ts": "2021-06-23 05:37:40:575+0000",     "paramsstatus": {"success",
        "resmsgiderrmsg": null,
    },
    "msgidresponseCode": "5e763bc2-b072-440d-916e-da787881b1b9OK",
    "result": {
   "err": null,
   "{{userid}}" : "Enrolment Deleted Succesfully"
    }
}
"status
GET - /v1/summary/download/:userId
Expand
titleDELETE - /v1/summary/delete/:userId - To Delete specific enrolments
title

Request:

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

Response:

Code Block
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