Versions Compared

Key

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

Problem Statement

...

  1. Sunbird Platform will expose an API for end user to initiate update content
  2. Sunbird Platform will log the request in DB and pass the user a generated process Id
  3. Sunbird Platform will send the request with processId to kafka message queue
  4. Request will be picked up by Learning platform and would start the processing of update content based on the request
  5. Sunbird Platform will use a listener to get the status update and store in DB from the kafka based on processId

...

pros and cons of both approaches

approachesĀ proscons

1.without content service

loosely coupled
2.with content serviceĀ 
reply on content service
Problem Statement

What is the API for update content?

...

status codeerror codeerror message
400MANDATORY_PARAMETER_MISSINGMandatory parameter {script,version} is missing.
400UPDATE_FAILEDData updation failed due to invalid Request

Sample Request and Response:


No Format
nopaneltrue
Request

{
	request : {
		"script" : "course_rename",
		"version" : "1.2",
		"content" : {
			"oldName" : "AB",
			"newName" : "ab"
		}	
	}
}

Response

{
  "id": "api.content.update",
  "result": {
		"processId" : "01262366359399628812"
	}
}

...

status codeerror codeerror message
400INVALID_PROCESS_IDInvalid Process Id

Sample Request and Response:

No Format
nopaneltrue
Request

GET /v1/content/update/status/01262366359399628812

Response

{
  "id": "api.content.update.status",
  "result": {
		"status" : "FAILURE",
		"message" : "Operation to update failed"
	}
}

...

returns an array of processes related to user

nametypedescription
processIdtextthe process id
scripttextthe script for which process exists
versiontextversion of the script

Errors:

None

Sample Request and Response:


No Format
nopaneltrue
Request

GET /v1/content/update/processes

Response

{
  "id": "api.content.update.processes",
  "result": {
		processes : [{
			"processId" : "01262366359399628812",
			"script" : "course_rename",
			"version" : "1.2"
		}]
	}
}

...