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:

...

languagejson

...

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

    "request": {
      "contentId" : "content_123",
      "contextId" 
// required
: "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,
      

API Spec

Content View Start

Expand
titlePOST - /v1/view/start

Request Spec:

Code Block
languagejson
{
    "idmsgid": "api.view.start",5e763bc2-b072-440d-916e-da787881b1b9",
        "vererr": "v1"null,
        "tsstatus": "2021-06-23 05:37:40:575+0000success",
        "paramserrmsg": null
{    },
    "msgidresponseCode": "5e763bc2-b072-440d-916e-da787881b1b9"
    }OK",
    "requestresult": {
        "userId": "{{userIdcontentId}}": ",Progress started"
     // required
   }
}

4XX or 5XX Error Response:

Code Block
languagejson
{
    "id": "api.view.start",
    "contentIdver": "{{contentId}}v1",
  // required "ts":   "2021-06-23 05:37:40:575+0000",
    "collectionIdparams" : "{{collectionId}}"
 // optional.required      "resmsgid": null,
        "msgid": "5e763bc2-b072440d-916e-da787881b1b9",
        "err": ERR_Error_Code,
        "status": "failed",
        "errmsg": ERR_error_msg
    },
  only when contextid is present   "responseCode": "BAD_REQUEST"/"SERVER_ERROR",
    "contextIdresult": "{{batchId}}"{
      // optionalerror message
    }
}

Sample

Requests

Response:

Sample1: consume organic contentValid 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": null,
        "status": "success",
        "errmsg": null
    },
    "requestresponseCode": {
 "OK",
    "userIdresult" : "user_123",{
      "contentId" : "content_123": "Progress started"
    }
}

Sample2: consume content through collectionInValid Request

Code Block
languagejson
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
         "params": {"msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
         "err": "CLIENT_ERROR",
        "msgidstatus": "5e763bc2-b072-440d-916e-da787881b1b9"FAILED",
    }     "requesterrmsg": {ERR_error_msg
    },
    "userIdresponseCode" : "userBAD_123REQUEST",
      "contentIdresult": {
: "content_123",       "collectionIdrequest.contentId" : "collection_123"Content Id cannot be empty"
     }
}

Sample3: consume content through contextInvalid 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"
da787881b1b9",
         "err": "CLIENT_ERROR",
   }     "requeststatus": "FAILED",
 {       "userIderrmsg" : "user_123",ERR_error_msg
    },
    "contentIdresponseCode" : "contentBAD_123REQUEST",
      "collectionIdresult": : "collection_123",{
        "request.contextId" : "context_123"Invalid Context Id"
       }
}

Response:

200 Ok Response

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": {
  ",
     "resmsgidparams": null,
{
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
    }
    "errrequest": null,{
        "statuscontentId": "success{{contentId}}",         "errmsg": null// required   
   },     "responseCodecollectionId" : "OK{{collectionId}}", //optional
        "resultcontextId": "{{batchId}}",         "{{contentId}}": "Progress started" // optional
    } }

4XX or 5XX Error Response:

Code Block
languagejson
{     "idprogressDetails": "api.view.start",
 {   "ver": "v1",     "ts": "2021-06-23 05:37:40:575+0000",     "params": {
    // required. Progress details specific 
   "resmsgid": null,     ...    "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",         "err": ERR_Error_Code,         "status": "failed",         "errmsg": ERR_error_msg   for each },mimetype 
   "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},
        "msgidtimeSpent": "5e763bc2-b072-440d-916e-da787881b1b9", : {{timeSpent}}          "err": null,// required
    }
}

Sample Requests:

Sample1: Without Context

Code Block
languagejson
{
    "statusid": "successapi.view.update",
        "errmsgver": null
    }"v1",
    "responseCodets": "OK2021-06-23 05:37:40:575+0000",
    "resultparams": {

       "content_123msgid": "Progress started"
    }
}

Sample2: InValid Request

Code Block
languagejson
{5e763bc2-b072-440d-916e-da787881b1b9"
    "id": "api.view.start",}
    "verrequest": "v1", {
      "tscontentId" : "2021-06-23 05:37:40:575+0000",content_123",
      "paramsprogressDetails" : {
         "resmsgidmimetype" : null"appliation/pdf",
         "msgidprogress" : "5e763bc2-b072-440d-916e-da787881b1b9",
  20
       }
       "errtimespent" : "CLIENT_ERROR",
10
}

Sample1: With Context

Code Block
languagejson
{
       "statusid": "FAILEDapi.view.update",
  
     "errmsgver": ERR_error_msg
    }"v1",
    "responseCodets": "BAD_REQUEST2021-06-23 05:37:40:575+0000",
    "resultparams": {

       "request.contentIdmsgid": "Content Id cannot be empty"
"5e763bc2-b072-440d-916e-da787881b1b9"
    }
   }
}

Content View Update

Expand
titlePOST - /v1/view/update

Request:

Code Block
languagejson
{ "request": {
      "idcontentId" : "api.view.updatecontent_123",
      "vercollectionId" : "v1collection_123",
      "tscontextId" : "2021-06-23 05:37:40:575+0000context_123",
      "paramsprogressDetails" : {
         "msgidmimetype" : "5e763bc2-b072-440d-916e-da787881b1b9"
    } "application/pdf",
         "progress" : 20
       }
      "requesttimespent" : {
   10
}

Response:

Code Block
languagejson
200 OK:
{
    "userIdid": "{{userId}}api.view.update",
    "ver": "v1",
    "ts": "2021-06-23  // requiredcontents05:37:40:575+0000",
    "params": {
        "contentIdresmsgid": "{{contentId}}"null,
       // required  "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
          "collectionIderr" : "{{collectionId}}"null,
//optional. required only when           "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
        "{{contentId}}": "Progress Updated"
    }
contextId}
present
in4XX requestor 5XX Error:
{
     "contextIdid": "{{batchId}}api.view.update",
    "ver": "v1",
   // optional
  "ts": "2021-06-23 05:37:40:575+0000",
      "progressDetailsparams": {}
         // required. Progress details specific"resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": ERR_Error_Code,
        "status": "failed",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST"/"SERVER_ERROR",
    for each mimetype"result": {
     }
}

Sample Requests:

Sample1: Without Context

Content View End

Expand
titlePOST - /v1/view/end

Request:

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",{{contentId}}"       "progressDetails" : { //required.
        "mimetypecollectionId" : "appliation/pdf{{collectionId}}",  // required.only when 
    "progress" : 20,               "timespent" : 10        } }

Sample1: With Context

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

Sample Request:

Sample1: Without Context

Code Block
languagejson
{
    "contentIdid" : "content_123api.view.end",
      "collectionIdver" : "collection_123v1",
 
    "contextIdts" : "context_1232021-06-23 05:37:40:575+0000",

     "progressDetailsparams" : {
 
       "mimetypemsgid" : "application/pdf",5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "progressrequest" : 20,
  {
      "timespentcontentId" : 10
 "content_123"
     }
}

ResponseSample2: With Context

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",    }
    "errmsgrequest": null
  {
 },     "responseCodecontentId" : "OKcontent_123",
      "resultcollectionId" : {
 "collection_123",
      "{{contentId}}contextId" : "Progress Updatedcontext_123"   
 } }  4XX or 5XX Error:
}

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",
        "err": ERR_Error_Codenull,
        "status": "failedsuccess",
        "errmsg": ERR_error_msgnull
    },
    "responseCode": "BAD_REQUEST"/"SERVER_ERROR",
    "result": {OK",
    "result": {
        "{{contentId}}": "Progress ended"
    }
}
}

Content View EndRead

json

Sample1: Without context(organic consumption)

Expand
titlePOST - /v1/view/endread

Request:

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

Response:

Code Block
languagejson
{
    "id": "api.view.read",
    "ver": "v1",
    "contentIdts": "{{contentId}}"2021-06-23 05:37:40:575+0000",
         //required."params": {
        "collectionIdresmsgid" : "{{collectionId}}",  // required.required only whennull,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
         contextId present in request 
 "responseCode": "OK",
    "result": {
      "contextIduserId" : "{{batchIduserId}}",
      "contentId" : "{{contentId}}",
   // optional  "type" : "content"
} }

Sample Request:

Sample1: Without Context

Code Block
languagejson
{     "id": "api.view.end",contents:[{
    	"vercollectionId": "v1{{collectionId}}",
    	"tscontextId": "2021-06-23 05:37:40:575+0000{{batchId}}",     "params":
{        "msgidcontentId": "5e763bc2-b072-440d-916e-da787881b1b9"{{contentId}}",
    }     "requeststatus" : "{{content_status}}"  
        "userIdprogressDetails" : "user_123",{}"
       "contentId" : "content_123"}]
    }
}

Sample Response:

Sample2: With Context

Code Block
language
Code Block
{
    "id": "api.view.endread",
    "ver": "v1",
    "ts": "2021-06-23 05:37:40:575+0000",
    "params": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {,
        "userIderr" : "user_123"null,
        "contentIdstatus" : "content_123success",
        "collectionIderrmsg": : "collection_123",null
    },
    "contextIdresponseCode" : "context_123OK",
       }

Response:

Code Block
languagejson
"result": {
    	"iduserId": "api.view.end",user_123"
        "vercontentId": "v1content_123",
        "tstype": "2021-06-23 05:37:40:575+0000","content"
        "paramscontents":[{
{           "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 ended"}
        }]
    }
}

Content View Read

Expand
titlePOST - /v1/view/read
Request:

Example2: With context or collection

Code Block
languagejson
{
    "id": "api.view.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",
    "requestresult": {
        	"userId": "{{userId}}",    // requireduser_123"
        "contentIdscontentId": ["{{contentId_1}}content_123",
"{{contentId_2}}"], //required
        "collectionIdtype" : "{{collectionId}}content",
//optional.required only when      "contents":[{
           "contentid" : "content_123",
           "collectionid" :"collection_123",
           "contenxtid"        contextId present in request: "context_123"
            "contextIdstatus" : "{{batchId}}"1",
   // optional      }
}

Response:

Code Block
languagejson
 "progressDetails": {
    "id": "api.view.read",     "ver": "v1",     "tsmimeType" : "2021-06-23 05:37:40:575+0000",application/video"
    "params": {         "resmsgidprogress" :20
   null,         "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",}
        }]
"err": null,   }
}
Expand
titlePOST - /v1/view/read?context=all

Request:

Code Block
languagejson
{
    "statusid": "successapi.view.read.contextall",
        "errmsgver": null
    }"v1",
    "responseCodets": "OK2021-06-23 05:37:40:575+0000",
    "resultparams": {
      	 "userIdmsgid": "{{userId}}",5e763bc2-b072-440d-916e-da787881b1b9"
    }
    	"collectionIdrequest": "{{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,
    "errstatus": null"success",
    "errmsg": null
  },
  "statusresponseCode": "success",OK",
  "result": {
    ...
    ...                   "errmsg": null            },//requested_data
    "responseCodetype": "OKcontextall",
    "resultcontents" : {[      	"userId": "user_123",           "contents": [{  // List of all contents irresepcitvie of context
 "contentId": "content_123",   ]
   }    "status" : "1",      
}

Sample Response:

Code Block
languagejson
{
  "progressDetailsid": "{"api.view.read.contextall",
  "ver": "v1",
  "ts":    "2021-06-23 05:37:40:575+0000",
  "progressparams" :20, {
    "resmsgid": null,
     "msgid": "timespent" : 105e763bc2-b072-440d-916e-da787881b1b9",
    "err": null,
      }""status": "success",
    "errmsg": null
  }],
  "responseCode": "OK",
 }
}

Example2: With context

Code Block
languagejson
{
  "result": {
  "iduserId" : "api.view.readuser_123",
    "vercollectionId" : "v1",
 collection_123"
  "tscontents": "2021-06-23 05:37:40:575+0000",[
    {
      "paramsuserid": {
  :"user_123",
      "resmsgidcontentId": null"content_123",

       "msgidstatus": "5e763bc2-b072-440d-916e-da787881b1b91",

       "errprogressDetails": null,{
        "statusprogress": "success"20,
        "errmsgtimespent": 10
 null     },
    "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:

{ "request": { "userId": "{{userId}}",
Code Block
languagejson
{
           //required"request": {
        "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}}",
   ",
    "collectionIderr": "{{collectionId}}",
   null,
    "contextIdstatus": "{{batchId}}success",
        "enrolledDateerrmsg": 1624275377301,null
     },
  "activeresponseCode": true"OK",

       "contentStatusresult": {
         "userId": "{{contentIduserId}}":,
{{status}}        "collectionId": "{{collectionId}}",
        "assessmentStatuscontextId": {
"{{batchId}}",
         "assessmentIdenrolledDate": {
1624275377301,
           "scoreactive": {{best_score}},
    true,
        "max_scorecontentStatus": {{max_score}}
          "{{contentId}}": {{status}}
        },
        "collectionassessmentStatus": {
          "identifierassessmentId": "{{collectionId}}",{
            "namescore": "{{collectionNamebest_score}}",
            "logomax_score": "{{logo Urlmax_score}}",

         "leafNodesCount": {{leafNodeCount}},
        },
 "description": "{{description}}"      "collection": {
 },         "issuedCertificatesidentifier": [{"{{collectionId}}",
          "name": "{{certNamecollectionName}}",
          "id": "certificateIdlogo": "{{logo Url}}",
          "tokenleafNodesCount": "{{certTokenleafNodeCount}}",
          "lastIssuedOndescription": "{{lastIssuedOndescription}}"
        }],
        "completedOnissuedCertificates": {{completion_date}},[{
          "progressname": "{{progresscertName}}",
          "statusid": {{status}}"certificateId",
  }
} 

Viewer Summary Delete

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

Response:

Code Block
languagejson
Response:  {     "idtoken": "api.summary.delete",{{certToken}}",
          "verlastIssuedOn": "v1",{{lastIssuedOn}}"
      "ts": "2021-06-23 05:37:40:575+0000", }],
        "paramscompletedOn": {{completion_date}},
        "resmsgidprogress": null{{progress}},
        "msgidstatus": "5e763bc2-b072-440d-916e-da787881b1b9",{{status}}
  }
     "err": null,
   }

Viewer Summary Download - Default Format : CSV

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

Response:

Code Block
{
    "statusid": "successapi.summary.download",
   
    "errmsgver": null
    }"v1",
    "responseCodets": "OK2021-06-23 05:37:40:575+0000",
    "resultparams": {
        "{{userid}}resmsgid": :null,
"Enrolment Deleted Succesfully"     } }
Expand
titleDELETE - /v1/summary/delete/:userId - To Delete specific enrolments

Request:

Code Block
{"msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "requesterr": {null,
        "userIdstatus": "{{userId}}success",
     // required   "errmsg": null
    },
    "collectionIdresponseCode" : "{{collectionId}}OK",
 //  required "result": {
      "contextIdurl": "{{batchIduserId}}"  // required_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": {
      "{{userid}}url" : "Enrolment Deleted Succesfully "{{userId}}_viewer_summary.json"
    }
}

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",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"
    }
}
GET - /v1/summary/download/:userId?format=json
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
title

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