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:

...

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-
01-01T00:00:00+05:30", //mandatory. Timestamp of the request
06-23 05:37:40:575+0000",
    "params": {
        "
msgid
resmsgid": 
"4f04da60-1e24-4d31-aa7b-1daf91c46341" // unique request message id
null,
UUID
     
},
   
request: {
"msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        
// request data
"err": null,
        "status": "success",
        "errmsg": null
    },
    
// required
"responseCode": "OK",
    
}
"result": {
        "content_123": 

API Spec

Content View Start

Expand
titlePOST - /v1/view/start
Request Spec:
"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",
    },     "requesterr": {"CLIENT_ERROR",
        "userIdstatus": "{{userId}}FAILED",   
   // required         "contentIderrmsg": "{{contentId}}"ERR_error_msg
  // required   },
     "collectionIdresponseCode" : "{{collectionId}}"  // optional.required only when contextid is presentBAD_REQUEST",
    "result": {
        "contextIdrequest.contentId": "{{batchId}}" // optional Content Id cannot be empty"
    }
}

Sample Requests:

Sample1: consume organic content

Sample3: Invalid ContextId in Request

Code Block
languagejson
SampleRequest1
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:5040:175575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
da787881b1b9",
         "err": "CLIENT_ERROR",
        "status": "FAILED",
   }     "requesterrmsg": { ERR_error_msg
    },
    "userIdresponseCode" : "userBAD_123REQUEST",
    "result": {
        "contentIdrequest.contextId" : "content_123Invalid Context Id"
    }
}
Sample2: consume content through collection

Content View Update

Expand
titlePOST - /v1/view/update

Request:

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": {
     
"userId" : "user_123",       "contentId" : "content_123{{contentId}}",       "collectionId" : "collection_123"   // required   
   }

Sample3: consume content through context

Code Block
languagejson
{     "idcollectionId" : "api.view.start{{collectionId}}", //optional
        "vercontextId": "v1{{batchId}}",     "ts": "2021-06-23 05:37:40:575+0000",     "params": {// optional
        "msgidprogressDetails": "5e763bc2-b072-440d-916e-da787881b1b9"{     }     "request": {       "userId" : "user_123",
// required. Progress details specific 
    "contentId" : "content_123",   ...    "collectionId" : "collection_123",       "contextId" : "context_123"           }

Response:

200 Ok Response:

Code Block
languagejson
{     "id": "api.view.start",     "ver": "v1",
  for each mimetype 
 "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",     "resulttimeSpent" : {{timeSpent}}         "{{contentId}}": "Progress started" // required
    }
}
4XX or 5XX Error Response:

Sample Requests:

Sample1: Without Context

Code Block
languagejson
{
    "id": "api.view.startupdate",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,

       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    }
    "errrequest": ERR_Error_Code,
 {
      "statuscontentId" : "failedcontent_123",
 
      "errmsgprogressDetails" : ERR_error_msg{
    },     "responseCodemimetype" : "BAD_REQUEST"appliation/pdf"SERVER_ERROR",
         "resultprogress" : {20
       }
 // error message     }"timespent" : 10
}

Sample Response:

Sample1: Valid RequestWith 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"
    }
    "resmsgidrequest": null,
 {
      "msgidcontentId" : "5e763bc2-b072-440d-916e-da787881b1b9content_123",
      "collectionId" : "err": null,
 collection_123",
      "statuscontextId" : "successcontext_123",
        "errmsgprogressDetails" : null{
    },     "responseCodemimetype" : "OKapplication/pdf",
         "resultprogress" : {20
       }
 "content_123": "Progress started"   "timespent" : }10
}

Sample2Response: InValid Request

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",
         "err": "CLIENT_ERROR"null,
        "status": "FAILEDsuccess",
        "errmsg": ERR_error_msgnull
    },
    "responseCode": "BAD_REQUESTOK",
    "result": {
        "request.{{contentId}}": "Progress Updated"Content
 Id cannot be empty"}
}

4XX or }
}

Content View Update

Expand
titlePOST - /v1/view/update

Request:

Code Block
languagejson
5XX Error:
{
    "id": "api.view.update",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
,
   }     "requesterr": {ERR_Error_Code,
        "userIdstatus": "{{userId}}",       "failed",
       // required  "errmsg": ERR_error_msg
    },
    "contentIdresponseCode": "{{contentId}}"BAD_REQUEST"/"SERVER_ERROR",
    "result": {
 // required  }
}

Content View End

Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{
        "collectionIdid" : "{{collectionId}}api.view.end",
//optional. required only when "ver": "v1",
        "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
        "contentId": "{{contentId}}"        contextId present in request //required.
        "contextIdcollectionId" : "{{batchIdcollectionId}}",          // optionalrequired.only when 
      "progressDetails": {}          // required. Progress details specific                              contextId present in request 
        "contextId": "{{batchId}}",            for each mimetype// optional
    }
}

Sample RequestsRequest:

Sample1: Without Context

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": {
      "userId" : "user_123",
      "contentId" : "content_123",
      "progressDetails" : {
         "mimetype" : "appliation/pdf",
         "progress" : 20,
 ": {
       "timespentcontentId" : 10
   "content_123"
   } }

Sample1Sample2: With Context

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": {
      "userId" : "user_123",
      "contentId" : "content_123",
      "collectionId" : "collection_123",
      "contextId" : "context_123",
      "progressDetails" : {
         "mimetype" : "application/pdf",
         "progress" : 20,
         "timespent" : 10123"   
     } }

Response:

Code Block
languagejson
200 OK:
{
    "id": "api.view.updateend",
    "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 Updatedended"
    }
}

4XX or 5XX Error:

Content View Read

Expand
titlePOST - /v1/view/read

Request:

Code Block
languagejson
{
    "id": "api.view.update",read",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "vermsgid": "v1",5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "tsrequest": "2021-06-23 05:37:40:575+0000", {
        "paramscontentId": {{contentId}}, //required
        "resmsgidcollectionId" : null"{{collectionId}}", //optional 
        "msgidcontextId": "5e763bc2-b072-440d-916e-da787881b1b9",{{batchId}}"   // optional
     }
}

Response:

Code Block
languagejson
{
    "errid": ERR_Error_Code,"api.view.read",
    "ver": "v1",
    "statusts": "failed2021-06-23 05:37:40:575+0000",
        "errmsgparams": ERR_error_msg{
    },
    "responseCoderesmsgid": "BAD_REQUEST"/"SERVER_ERROR",null,
        "resultmsgid": {"5e763bc2-b072-440d-916e-da787881b1b9",
    }
}

Content View End

Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{    "err": null,
        "idstatus": "api.view.endsuccess",
        "vererrmsg": "v1" null
    },
    "tsresponseCode": "2021-06-23 05:37:40:575+0000OK",
    "paramsresult": {
       "msgiduserId" : "5e763bc2-b072-440d-916e-da787881b1b9"{{userId}}",
      "contentId" : "{{contentId}}",
      "type" : "requestcontent":
  {    contents:[{
    	"userIdcollectionId": "{{userIdcollectionId}}",
    	"contextId": "{{batchId}}",  
     //required
        "contentId": "{{contentId}}",
         //required.
        "collectionId"status" : "{{collectionIdcontent_status}}",  
   // required.required only when  "progressDetails": "{}"
        }]
    }
}

Sample Response:

Sample1: Without context(organic consumption)

Code Block
{
    "id": "api.view.read",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        contextId present in request"resmsgid": null,
           "contextIdmsgid": "{{batchId}}5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
// optional     }
}

Sample Request:

Sample1: Without Context

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-da787881b1b9user_123"
    }    "contentId": "request": {content_123",
        "userIdtype" : "user_123",content"
        "contentIdcontents":[{
: "content_123"     }

Sample2: With Context

Code Block
languagejson
{     "idcontentid" : "api.view.endcontent_123",
           "vercollectionid" : "v1content_123",
    "ts": "2021-06-23 05:37:40:575+0000",     "paramscontenxtid" : {"content_123"
           "msgidstatus" : "5e763bc2-b072-440d-916e-da787881b1b9"1",
      }     "requestprogressDetails": {
      "userId       "mimeType" : "user_123",application/video"
              "contentIdprogress" :20
"content_123",       "collectionId" : "collection_123",    }
    "contextId" : "context_123"  }]
    }
}

ResponseExample2: With context or collection

Code Block
languagejson
{
    "id": "api.view.endread",
    "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 ended"
    }
}

Content View Read

Expand
titlePOST - /v1/view/read

Request:

Code Block
languagejson
{    },
    "idresponseCode": "api.view.readOK",
    "ver"result": {
    	"userId": "v1",user_123"
        "tscontentId": "2021-06-23 05:37:40:575+0000",content_123",
        "paramstype": {"content"
        "msgidcontents": "5e763bc2-b072-440d-916e-da787881b1b9"[{
      }     "requestcontentid" : {"content_123",
           "userIdcollectionid" : "{{userId}}"collection_123", 
  // required         "contentIdscontenxtid" : ["{{contentId_1}}", "{{contentId_2}}"], //requiredcontext_123"
           "collectionIdstatus" : "{{collectionId}}1",
//optional.required only when         "progressDetails": {
             "mimeType" : "application/video"
              "progress" :20
          contextId present in}
request        }]
 "contextId": "{{batchId}}"  }
}
/ optional } }Response
Expand
titlePOST - /
v1/view/read?context=all

Request:

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
": {
   },     "responseCodemsgid": "OK",5e763bc2-b072-440d-916e-da787881b1b9"
    "result": {}
    	"userIdrequest": "{{userId}}",     	"collectionId": "{{collectionId}}", // optional     	"contextId": "{{batchId}}",  // optional     // either of the "contents": [{
 three options is mandatory
        "contentId": "{{contentId}}",  //optional
        "statuscollectionId" : "{{content_statuscollectionId}}"   // 0,1 or 2 
  //optional
        "progressDetailscontextId" : "{{contextId}}"         }]//optional
     }
}

Sample Response:

Sample1: Without context

code

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",
    "paramserrmsg": {null
     },
  "resmsgidresponseCode": null"OK",
  "result": {
    "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",...
    ...     "err": null,         "status": "success",         "errmsg": null     },//requested_data
    "responseCodetype": "OKcontextall",
    "resultcontents" : { [                    	"userId": "user_123",
        "contents": [{
 // List of all contents irresepcitvie of context
     ]
   }     "contentId": "content_123",      
}

Sample Response:

Code Block
languagejson
{
  "statusid" : "1api.view.read.contextall",
  "ver": "v1",
      "progressDetailsts": "{
2021-06-23 05:37:40:575+0000",
       "params": {
    "progressresmsgid": :20null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    "timespenterr" : 10null,
    "status": "success",
    }"errmsg": null
  },
  "responseCode": "OK",
 }] "result": {
  }
}

Example2: With context

Code Block
languagejson
{
 "userId" : "user_123",
  "idcollectionId" : "api.view.read",collection_123"
    "vercontents":[
"v1",    {
"ts": "2021-06-23 05:37:40:575+0000",    "userid" :"params": {
 user_123",
      "resmsgidcontentId": null"content_123",
        "msgidstatus": "5e763bc2-b072-440d-916e-da787881b1b91",
        "errprogressDetails": null,{
        "statusprogress": "success"20,
        "errmsgtimespent": null10
      },
    "responseCode": "OK",},
    {
"result": {     	"userIduserid" : "user_123",
        "collectionId" : "collection_!23",
        "contextId" : "context_123",
        "contents":
[{           "contentId": "content_123",
          "progressDetails": "{
   : {
         "progress": :20,
   
         "timespent" : 10
   
      }",
          status "status": "12"
    }
   }]

   }
}

Content Submit Assess

Expand
titlePOST - /v1/assessment/submit

Request:

Code Block
languagejson
{
    "id": "api.assess.submit",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }     
    "request": {
        "userId": "{{userId}}",               // required  
        "contentId": "{{contentId}}",         // required  
        "collectionId" : "{{collectionId}}",  // required
        "contextId": "{{batchId}}",           // required 
        "attemptId" : "{{attemptId}}",        // required
        "assessments": [{
            {{assess_event}}      // required for self-assess contents
        }]
    }
}

Response:

Code Block
{
    "id": "api.view.assess",
    "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}}": "Score Updated"
    }
}

...

Expand
titlePOST - /v1/assessment/read

Request:

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

Response:

Code Block
languagejson
{
    "id": "api.assessment.read",
    "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": "{{userId}}",
        "contentId" : "{{contentId}}"
    	"collectionId": "{{collectionId}}",
    	"contextId": "{{batchId}}",
        "assessments": [{
          "attemptId" : "{{attemptId}}",
    	  "score": {{score}},
    	  "max_score": {{max_score}}
        },{
          "attemptId" : "{{attemptId}}",
    	  "score": {{score}},
    	  "max_score": {{max_score}}
        }
        ]
    }
}

...

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

Response:

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}}",
        "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}}
      }
    ]
  }
}

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": "user_123",
        "collectionId": "collection_123",
        "contextId": "context_123",
        "enrolledDate": 1624275377301,
        "active": true,
        "contentStatus": {
          "content_123": 2,
          "content_456": 1
        },
        "assessmentStatus": {
          "content_123": {
            "score": {{best_score}},
            "max_score": {{max_score}}
          }
        },
        "collection": {
          "identifier": "collection_123",
          "name": "Mathematics",
          "logo": "http://logoimage",
          "leafNodesCount": 4,
          "description": "Dummy Collection"
        },
        "issuedCertificates": [{
          "name": "Certificate-1",
          "id": "cert_123",
          "token": "sdfjkldjk23j2kj2k3jk2",
          "lastIssuedOn": "1624275377301"
        }],
        "completedOn": "2021-09-10",
        "progress": 70,
        "status": 1
      }
    ]
  }
}

...

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": "OK", {
      "url": "{{userId}}_viewer_summary.json"
    "result": {}
}

Viewer Summary Download - Default Format : CSVDelete

Expand
titleGET DELETE - /v1/summary/downloaddelete/:userId?all - 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{{userid}}" : null,"Enrolment Deleted Succesfully"
    }
}
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
    }
}
Expand
titleGET - /v1/summary/download/:userId?format=json

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,
        "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 wellIn the summary list api, if the context is program, how to show the program metadata