Versions Compared

Key

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

Problem Statement

...

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


Problem Statement

What is the API for get all the processes by a user

Solution approach

URL:

GET /v1/content/update/processes

Headers:

Authorization

X-authenticated-user-token

Request Params:

None

Response Params:

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

...