Versions Compared

Key

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

Introduction:

...

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": {
        "userId": "{{userId}}",       // required
        "contentId": "{{contentId}}"   // required
        "collectionId" : "{{collectionId}}"  // optional.required 
                                                     only when contextid is present
        "contextId": "{{batchId}}" // optional 
    }
}

Sample Requests:

Sample1: consume organic content

Code Block
languagejson
SampleRequest1
{
    "id": "api.view.start",
    "ver": "v1",
    "ts": "2021-06-23 05:37:50:175+0000",
    "params": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
      "userId" : "user_123",
      "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": {
      "userId" : "user_123",
      "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": {
      "userId" : "user_123",
      "contentId" : "content_123",
      "collectionId" : "collection_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-b072-440d-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"
    }
}

...

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": {
        "userId": "{{userId}}",              // required  
        "contentId": "{{contentId}}",        // required   
        "collectionId" : "{{collectionId}}", //optional. required only when 
                                                     contextId present in request
        "contextId": "{{batchId}}",          // optional
        "progressDetails": {}          // required. Progress details specific 
                                                      for each mimetype
    }
}

Sample Requests:

Sample1: Without Context

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

Response:

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

4XX or 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",
        "err": ERR_Error_Code,
        "status": "failed",
        "errmsg": ERR_error_msg
    },
    "responseCode": "BAD_REQUEST"/"SERVER_ERROR",
    "result": {
    }
}

...

Expand
titlePOST - /v1/view/end

Request:

Code Block
languagejson
{
    "id": "api.view.end",
    "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.required only when 
                                                   contextId present in request 
        "contextId": "{{batchId}}",           // optional
    }
}

Sample Request:

Sample1: Without Context

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

Sample2: With Context

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

Response:

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

...

Expand
titlePOST - /v1/view/read

Request:

Code Block
languagejson
{
    "id": "api.view.read",
    "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}}", //optional.required only when 
                                                   contextId present in request 
        "contextId": "{{batchId}}"   // optional
     }
}

Response:

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",
    "result": {
    	"userId": "{{userId}}",
    	"collectionId": "{{collectionId}}", // optional
    	"contextId": "{{batchId}}",  // optional
        "contentId": "{contentId}",
        "status" : "{{content_status}}"   // 0,1 or 2 
        "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": {
        "resmsgid": null,
        "msgid": "5e763bc2-b072-440d-916e-da787881b1b9",
        "err": null,
        "status": "success",
        "errmsg": null
    },
    "responseCode": "OK",
    "result": {
    	"userId": "user_123"
          "contentId": "content_123",
          "status" : "1",
          "progressDetails": {
             "progress" :20,
             "timespent" : 10
          }
        }
    }
}

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",
    "result": {
    	"userId": "user_123",
        "collectionId" : "collection_!23",
        "contextId" : "context_123",
        "contentId": "content_123",
          "progressDetails": "{
             "progress" :20,
             "timespent" : 10
          }"
          "status" : "1"
    }
}
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": {
       "msgid": "5e763bc2-b072-440d-916e-da787881b1b9"
    }
    "request": {
        "userId": "{{userId}}",    // required
        "contentId": "{{contentId}}" //required
     }
}

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": { [             	"userId": "{{userId}}",         "contentDetails": [       // ArrayList of thecontent contents details with context and without context
   
    {
      "userId"          : "{{userId}}",     
        // Content Map without context
          "contentId": "{contentId}",
   
      "status" : "{{content_status}}",
  // 0,1 or 2 
              "progressDetails": "{}"

       },
   
    {
      "userId"                          // Content Map with context
          : "{{userId}}",
      "contentId": "{{contentId}}",
   
      "collectionId" : "{{collectionId}}",
 
        "contextId" : "{{contextId}}",
          "status" : "{{content_status}}"   
,
         "progressDetails": "{}"
     }
  }]
    }
}

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,
        "status": "success",
   
    "errmsg": null
 
  },

   "responseCode": "OK",
    "result": [
    {
      	"userIduserid" : "user_123",
        "contentDetails": [{
   
      "contentId": "content_123",
  
       "status" : "1",
 
        "progressDetails": {
             "progress": :20,
    
        "timespent" : 10
          }
 
      },
    {
    {  "userid" : "user_123"
      "collectionId" : "collection_!23",
   
      "contextId" : "context_123",

         "contentId": "content_123",
          ""progressDetails": {
 
           "progress": :20,
             "timespent" : 10
   
      }
 ,
        "status" : "1"
        }
     
  }]
    }
}

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
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:

language
Code Block
json
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}}" : "Enrolment Deleted SuccesfullyuserId}}_viewer_summary.csv"
    }
}
Request
Expand
titleDELETE GET - /v1/summary/deletedownload/:userId - To Delete specific enrolments
?format=json

Response:

Code Block
languagejson
{
    "requestid": {"api.summary.download",
    "ver": "v1",
    "userIdts": "{{userId}}2021-06-23 05:37:40:575+0000",
  // required  "params": {
        "collectionIdresmsgid" : "{{collectionId}}"null,
 // required         "contextIdmsgid": "{{batchId}}"  // required5e763bc2-b072-440d-916e-da787881b1b9",
       }
}

Response:

Code Block
languagejson
Response: 
{ "err": null,
      "id": "api.summary.delete",     "verstatus": "v1success",
    "ts": "2021-06-23 05:37:40:575+0000",
    "paramserrmsg": {null
        "resmsgid": null,
   },
    "msgidresponseCode": "5e763bc2-b072-440d-916e-da787881b1b9OK",

       "errresult": null,{
        "statusurl": "success",{{userId}}_viewer_summary.json"
        "errmsg": null}
}

Viewer Summary Delete

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

Response:

Code Block
languagejson
Response: 
{
    }"id": "api.summary.delete",
    "responseCodever": "OKv1",
    "resultts": {
"2021-06-23 05:37:40:575+0000",
    "{{userid}}params" : "Enrolment{
Deleted Succesfully"     } }

Viewer Summary Download - Default Format : CSV

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

Response:

Code Block
{ "resmsgid": null,
        "idmsgid": "api.summary.download",5e763bc2-b072-440d-916e-da787881b1b9",
        "vererr": "v1"null,
        "tsstatus": "2021-06-23 05:37:40:575+0000success",
        "paramserrmsg": {null
    },
    "resmsgidresponseCode": null"OK",
    "result": {
     "msgid{{userid}}" : "5e763bc2-b072-440d-916e-da787881b1b9",
 Enrolment Deleted Succesfully"
    }
 "err": null,
   }
expand
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
    }
}
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 well