Overview
As per the current design discussion, LP will be providing two APIs for reserving the dialcodes for textbook and releasing a specific number of dialcodes from the textbook respectively.
For storing the reserved dialcodes list against a textbook, there will be a metadata named reservedDialcodes.
As part of reserve API, asked number of dialcodes will get generated and reservedDialcodes metadata of particular textbook will get updated.
As part of release API, asked number of dialcodes will be release post validating dialcodes used in TOC and reserved dialcodes list.
Reserved Dialcode API:
POST - content/v3/dialcode/reserve/{content_id}
Request Header:
Authorisation: //Authorisation key
Content-Type: application/json'
X-Channel-Id: //Channel for which dialcode are getting generated'
{
"id": "ekstep.learning.content.dialcode.reserve",
"ver": "3.0",
"ts": "YYYY-MM-DDThh:mm:ssZ+/-nn.nn",
"params":
,
"request":
}
Request Body
{
"id": "ekstep.learning.content.dialcode.reserve",
"ver": "3.0",
"ts": "YYYY-MM-DDThh:mm:ssZ+/-nn.nn",
"params":
,
"request":
}
Validation Logic:
- If the content does not have any reserved dialcode, dialcode will be generated using autogenerated batch code, else existing dialcode's batchcode will be used.
- Content should belong to same channel.
- Content should be of Type Textbook, Collection, LessonPlan, Course
Release Dialcode API:
POST - content/v3/dialcode/release
Request Header:
Authorisation: //Authorisation key
Content-Type: application/json'
Request Body
{
"id": "ekstep.learning.content.dialcode.release",
"ver": "3.0",
"ts": "YYYY-MM-DDThh:mm:ssZ+/-nn.nn",
"params":
,
"request":
}
Validation Logic:
- release dialCodes count should not be greater than the difference of reserved dialcodes and total used dialcodes.
- Content should be of Type Textbook, Collection, LessonPlan, Course