# APIs

#### API Documentation:

Refer to \*\*\*\* the below various API documentation related to all the different APIs that are being consumed with in all the batch jobs.

#### Course Batch Management APIs are listed below:

## CourseBatch Read

> Fetch a particular Batch\
> This API is associated with fetching a particular batch on the Sunbird Platform.\
> The endpoint for Fetch a particular Batch is /batch/read/{Batch\_ID}\
> The fields marked with an asterisk (\*) are mandatory. They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Course Batch Management APIs","version":"1.0"},"tags":[{"name":"Course Batch APIs","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"coursebatchmanapiCourseBatchRead-200OK":{"title":"CourseBatchRead-200OK","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams1"},"responseCode":{"type":"string"},"result":{"$ref":"#/components/schemas/coursebatchmanapiResult"}}},"coursebatchmanapiParams1":{"title":"Params1","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}},"coursebatchmanapiResult":{"title":"Result","required":["response"],"type":"object","properties":{"response":{"type":"object"}}},"coursebatchmanapiCourseBatchCreate-400BadRequest-InvalidCourseId":{"title":"CourseBatchCreate-400BadRequest-InvalidCourseId","description":"CourseBatchCreate-400BadRequest-InvalidCourseId","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams1"},"responseCode":{"type":"string"},"result":{"type":"object"}}}}},"paths":{"/course/v1/batch/read/{batch-id}":{"get":{"tags":["Course Batch APIs"],"summary":"CourseBatch Read","description":"Fetch a particular Batch\nThis API is associated with fetching a particular batch on the Sunbird Platform.\nThe endpoint for Fetch a particular Batch is /batch/read/{Batch_ID}\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.","operationId":"CourseBatchRead","parameters":[{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"The alphanumeric string to access the API","required":true,"style":"simple","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"'The Content Type entity is the media type of the resource.Possible\\\n\\ media types can be:- \\n  - application/json'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"batch-id","in":"path","description":"Append a valid Batch ID To the Request URL","required":true,"style":"simple","schema":{"type":"string"}}],"responses":{"200":{"description":"SUCCESS. The **Fetch a batch** operation was successful!","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchRead-200OK"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-400BadRequest-InvalidCourseId"}}}}},"deprecated":false}}}}
```

## CourseBatch Update

> This API is associated with updating a batch on the Sunbird Platform.\
> The endpoint for Course Batch Update is /batch/update\
> The fields marked with an asterisk (\*) are mandatory. They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Course Batch Management APIs","version":"1.0"},"tags":[{"name":"Course Batch APIs","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"coursebatchmanapiCourseBatchUpdateRequest":{"title":"CourseBatchUpdateRequest","required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/coursebatchmanapiRequest"}}},"coursebatchmanapiRequest":{"title":"Request","required":["startDate","status","courseId","id"],"type":"object","properties":{"enrollmentType":{"type":"string","description":"possible values are {invite-only and open}"},"startDate":{"type":"string","description":"Batch start date"},"enrollmentEndDate":{"type":"string","description":"Batch enrollment end date"},"status":{"type":"integer","format":"int32","description":"Status of batch possible values are {0, 1 or 2}"},"courseId":{"type":"string","description":"Course id for which the user wants to update the batch"},"id":{"type":"string","description":"Batch id which the user wants to update"},"endDate":{"description":"Batch end date can be updated if end date hasnt expired","type":"string"}}},"coursebatchmanapiCourseBatchUpdate-200OK":{"title":"CourseBatchUpdate-200OK","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"coursebatchmanapiParams":{"title":"Params","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string","nullable":true}}},"coursebatchmanapiCourseBatchCreate-400BadRequest-InvalidCourseId":{"title":"CourseBatchCreate-400BadRequest-InvalidCourseId","description":"CourseBatchCreate-400BadRequest-InvalidCourseId","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams1"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"coursebatchmanapiParams1":{"title":"Params1","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}},"coursebatchmanapiCourseBatchCreate-500InternalServerError":{"title":"CourseBatchCreate-500InternalServerError","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams2"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"coursebatchmanapiParams2":{"title":"Params2","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string","nullable":true},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}}}},"paths":{"/course/v1/batch/update":{"patch":{"tags":["Course Batch APIs"],"summary":"CourseBatch Update","description":"This API is associated with updating a batch on the Sunbird Platform.\nThe endpoint for Course Batch Update is /batch/update\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.","operationId":"CourseBatchUpdate","parameters":[{"name":"Content-Type","in":"header","description":"'The Content Type entity is the media type of the resource.Possible\\\n\\ media types can be:- \\n  - application/json'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"The alphanumeric string for accessing the API","required":true,"style":"simple","schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"The body refers to the format of the request. - The body contains metadata about the batch to be updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchUpdateRequest"}}},"required":true},"responses":{"200":{"description":"SUCCESS. The **Update a batch** operation was successful!","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchUpdate-200OK"}}}},"400":{"description":"BAD REQUEST,**Update a batch** operation failed !The possible reason for failure is that you may have missed providing input for a mandatory parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-400BadRequest-InvalidCourseId"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-500InternalServerError"}}}}},"deprecated":false}}}}
```

## CourseBatch Search

> Lists the existing batches\
> This API is associated with fetching and listing existing batches\
> The endpoint for Lists the existing batches is /batch/list\
> The fields marked with an asterisk (\*) are mandatory. They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Course Batch Management APIs","version":"1.0"},"tags":[{"name":"Course Batch APIs","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"coursebatchmanapiCourseBatchSearchRequest":{"title":"CourseBatchSearchRequest","required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/coursebatchmanapiRequest1"}}},"coursebatchmanapiRequest1":{"title":"Request1","required":["filters"],"type":"object","properties":{"query":{"type":"string","description":"any text, it will do free text search eg. creatorDetails&orgDetails"},"filters":{"$ref":"#/components/schemas/coursebatchmanapiFilters"},"limit":{"type":"integer","description":"Number of batch user want in response","format":"int32"}}},"coursebatchmanapiFilters":{"title":"Filters","required":["courseId"],"type":"object","description":"here you can pass the attribute and values","properties":{"courseId":{"type":"string"}}},"coursebatchmanapiCourseBatchSearch-200OK":{"title":"CourseBatchSearch-200OK","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams"},"responseCode":{"type":"string"},"result":{"$ref":"#/components/schemas/coursebatchmanapiResult1"}}},"coursebatchmanapiParams":{"title":"Params","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string","nullable":true}}},"coursebatchmanapiResult1":{"title":"Result1","required":["response"],"type":"object","properties":{"response":{"$ref":"#/components/schemas/coursebatchmanapiResponse"}}},"coursebatchmanapiResponse":{"title":"Response","required":["count","content"],"type":"object","properties":{"count":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/coursebatchmanapiContent"},"description":""}}},"coursebatchmanapiContent":{"title":"Content","required":["identifier","createdFor","endDate","description","updatedDate","cert_templates","batchId","tandc","createdDate","createdBy","mentors","name","id","enrollmentType","enrollmentEndDate","courseId","collectionId","startDate","status"],"type":"object","properties":{"identifier":{"type":"string"},"createdFor":{"type":"array","items":{"type":"string"},"description":""},"endDate":{"type":"string"},"description":{"type":"string"},"updatedDate":{"type":"string","nullable":true},"cert_templates":{"$ref":"#/components/schemas/coursebatchmanapiCertTemplates"},"batchId":{"type":"string"},"tandc":{"type":"string","nullable":true},"createdDate":{"type":"string"},"createdBy":{"type":"string"},"mentors":{"type":"array","items":{"type":"string"},"description":""},"name":{"type":"string"},"id":{"type":"string"},"enrollmentType":{"type":"string"},"enrollmentEndDate":{"type":"string","nullable":true},"courseId":{"type":"string"},"collectionId":{"type":"string"},"startDate":{"type":"string"},"status":{"type":"integer","format":"int32"}}},"coursebatchmanapiCertTemplates":{"title":"CertTemplates","required":["Test_Template_prad"],"type":"object","properties":{"Test_Template_prad":{"$ref":"#/components/schemas/coursebatchmanapiTestTemplatePrad"}}},"coursebatchmanapiTestTemplatePrad":{"title":"TestTemplatePrad","required":["identifier","criteria","name","notifyTemplate","issuer","url","signatoryList"],"type":"object","properties":{"identifier":{"type":"string"},"criteria":{"$ref":"#/components/schemas/coursebatchmanapiCriteria"},"name":{"type":"string"},"notifyTemplate":{"$ref":"#/components/schemas/coursebatchmanapiNotifyTemplate"},"issuer":{"$ref":"#/components/schemas/coursebatchmanapiIssuer"},"url":{"type":"string"},"signatoryList":{"type":"array","items":{"$ref":"#/components/schemas/coursebatchmanapiSignatoryList"},"description":""}}},"coursebatchmanapiCriteria":{"title":"Criteria","required":["enrollment"],"type":"object","properties":{"enrollment":{"$ref":"#/components/schemas/coursebatchmanapiEnrollment"}}},"coursebatchmanapiEnrollment":{"title":"Enrollment","required":["status"],"type":"object","properties":{"status":{"type":"integer","format":"int32"}}},"coursebatchmanapiNotifyTemplate":{"title":"NotifyTemplate","required":["emailTemplateType","subject","stateImgUrl","regards","regardsperson"],"type":"object","properties":{"emailTemplateType":{"type":"string"},"subject":{"type":"string"},"stateImgUrl":{"type":"string"},"regards":{"type":"string"},"regardsperson":{"type":"string"}}},"coursebatchmanapiIssuer":{"title":"Issuer","required":["name","url"],"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}},"coursebatchmanapiSignatoryList":{"title":"SignatoryList","required":["image","name","id","designation"],"type":"object","properties":{"image":{"type":"string"},"name":{"type":"string"},"id":{"type":"string"},"designation":{"type":"string"}}},"coursebatchmanapiCourseBatchCreate-500InternalServerError":{"title":"CourseBatchCreate-500InternalServerError","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams2"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"coursebatchmanapiParams2":{"title":"Params2","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string","nullable":true},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}}}},"paths":{"/course/v1/batch/list":{"post":{"tags":["Course Batch APIs"],"summary":"CourseBatch Search","description":"Lists the existing batches\nThis API is associated with fetching and listing existing batches\nThe endpoint for Lists the existing batches is /batch/list\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.","operationId":"CourseBatchSearch","parameters":[{"in":"query","name":"orgdetails","description":"Extra data can be passed in query parameter with above mentioned key and comma separated value. Example,?orgdetails=email,name. Sunbird will take this query parameter and pass to content service as it is, and content service does the needful.","schema":{"type":"string"},"required":true},{"name":"Content-Type","in":"header","description":"-| 'The Content Type entity is the media type of the resource.Possible\\ \\ media types can be:- \\n  - application/json'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"The alphanumeric string for accessing the API","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"The body refers to the format of the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchSearchRequest"}}},"required":true},"responses":{"200":{"description":"SUCCESS. The **Lists the existing batches** operation was successful!","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchSearch-200OK"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-500InternalServerError"}}}}},"deprecated":false}}}}
```

## CourseBatch Create

> This API is associated with batch creation\
> The endpoint for Creates a Batch is /batch/create\
> The fields marked with an asterisk (\*) are mandatory. They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Course Batch Management APIs","version":"1.0"},"tags":[{"name":"Course Batch APIs","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"coursebatchmanapiCourseBatchCreateRequest":{"title":"CourseBatchCreateRequest","required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-Request"}}},"coursebatchmanapiCourseBatchCreate-Request":{"title":"CourseBatchCreate-Request","required":["courseId","name","description","enrollmentType","startDate","endDate"],"type":"object","properties":{"courseId":{"type":"string","description":"Content id for which user want to create a course"},"name":{"type":"string","description":"Name of the course"},"description":{"type":"string","description":"About courses"},"enrollmentType":{"type":"string","description":"Possible values are {invite-only and open}"},"startDate":{"type":"string","description":"Start data of the batch valid format is yyyy-mm-dd"},"endDate":{"type":"string","description":"End data of batch valid format is yyyy-mm-dd"},"createdFor":{"type":"array","description":"This will hold list of organisations id. This is mandatory in case of invite-only badge","items":{"type":"string"}},"mentors":{"type":"array","description":"List of user id who will take care of course","items":{"type":"string"}}}},"coursebatchmanapiCourseBatchCreate-200OK":{"title":"CourseBatchCreate-200OK","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams"},"responseCode":{"type":"string"},"result":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-Result"}}},"coursebatchmanapiParams":{"title":"Params","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string","nullable":true}}},"coursebatchmanapiCourseBatchCreate-Result":{"title":"Result2","required":["response","batchId"],"type":"object","properties":{"response":{"type":"string"},"batchId":{"type":"string"}}},"coursebatchmanapiCourseBatchCreate-400BadRequest-InvalidCourseId":{"title":"CourseBatchCreate-400BadRequest-InvalidCourseId","description":"CourseBatchCreate-400BadRequest-InvalidCourseId","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams1"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"coursebatchmanapiParams1":{"title":"Params1","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}},"coursebatchmanapiCourseBatchCreate-500InternalServerError":{"title":"CourseBatchCreate-500InternalServerError","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/coursebatchmanapiParams2"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"coursebatchmanapiParams2":{"title":"Params2","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string","nullable":true},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}}}},"paths":{"/course/v1/batch/create":{"post":{"tags":["Course Batch APIs"],"summary":"CourseBatch Create","description":"This API is associated with batch creation\nThe endpoint for Creates a Batch is /batch/create\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.","operationId":"CourseBatchCreate","parameters":[{"name":"Content-Type","in":"header","description":"- 'The Content Type entity is the media type of the resource.Possible\\\n\\ media types can be:- \\n  - application/json'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"The alphanumeric string to access the API","required":true,"style":"simple","schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"The body refers to the format of the request. - The body contains metadata about the new batch to be created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreateRequest"}}},"required":true},"responses":{"200":{"description":"Success example for batch create","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-200OK"}}}},"400":{"description":"BAD REQUEST,**create batch** operation failed !The possible reason for failure is that you may have missed providing input for a mandatory parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-400BadRequest-InvalidCourseId"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coursebatchmanapiCourseBatchCreate-500InternalServerError"}}}}},"deprecated":false}}}}
```

#### Course Enrolment APIs are listed below:

{% openapi src="/files/gFIP0JxhcF6dAmzqQjcD" path="/course/v1/enrol" method="post" %}
[courseenrolmentapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2Fgit-blob-143af4d7fef2b23e27fb75200d316d7e62671e11%2Fcourseenrolmentapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/gFIP0JxhcF6dAmzqQjcD" path="/course/v1/unenrol" method="post" %}
[courseenrolmentapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2Fgit-blob-143af4d7fef2b23e27fb75200d316d7e62671e11%2Fcourseenrolmentapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/h197vdMTmv59spsSipg5" path="/course/v1/user/enrollment/list/{user-id}" method="get" %}
[courseenrolmentapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2Fgit-blob-143af4d7fef2b23e27fb75200d316d7e62671e11%2Fcourseenrolmentapi.yaml?alt=media)
{% endopenapi %}

#### Course Progress APIs are listed below:

## Read Content State

> This API is used for reading the current progress of the course (content) consumed by a user. For example, the user can view and check the progress of a specific course or course(s) consumed.\
> \
> \- The endpoint for \*\*Read Course State\*\* is \`/read\`\
> \
> \- The fields marked with an asterisk (\*) are mandatory.\
> They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Course Progress APIs","version":"1.0"},"tags":[{"name":"Course Progress API(s)","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api","variables":{}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"ReadContentStateRequest":{"title":"ReadContentStateRequest","required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/Request"}}},"Request":{"title":"Request","required":["userId","courseId","contentIds","batchId"],"type":"object","properties":{"userId":{"type":"string","description":"This identifier uniquely identifies a user"},"courseId":{"type":"string","description":"Identifier of the course"},"contentIds":{"type":"array","items":{"type":"string"},"description":"This represents the list of content IDs for that course and batch. Associate only one courseId and batchId to the list of all content IDs."},"batchId":{"type":"string","description":"The identifier of the batch to which the course belongs."}}},"ReadContentState-Contentnotconsumed":{"title":"ReadContentState-Contentnotconsumed","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/Params"},"responseCode":{"type":"string"},"result":{"$ref":"#/components/schemas/Result"}}},"Params":{"title":"Params","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string","nullable":true}}},"Result":{"title":"Result","required":["contentList"],"type":"object","properties":{"contentList":{"type":"array","items":{"type":"string"},"description":""}}},"UpdateContentState-500InternalServerError":{"title":"UpdateContentState-500InternalServerError","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/Params2"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"Params2":{"title":"Params2","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string","nullable":true},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}}}},"paths":{"/course/v1/content/state/read":{"post":{"tags":["Course Progress API(s)"],"summary":"Read Content State","description":"This API is used for reading the current progress of the course (content) consumed by a user. For example, the user can view and check the progress of a specific course or course(s) consumed.\n\n- The endpoint for **Read Course State** is `/read`\n\n- The fields marked with an asterisk (*) are mandatory.\nThey cannot be null or empty.","operationId":"ReadContentState","parameters":[{"name":"Content-Type","in":"header","description":"The Content Type entity is the media type of the resource. Possible media types are:- \n  - application/json","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization\nkey. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"'The registered user token/key to authenticate user and execute\nthe API.'","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"Represents the body and form data parameters of the course progress state API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadContentStateRequest"}}},"required":true},"responses":{"200":{"description":"SUCCESS. The \"Read Course States\" operation was successful!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadContentState-Contentnotconsumed"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContentState-500InternalServerError"}}}}},"deprecated":false}}}}
```

## Update Content State

> This API is used to update the Course(content) state as consumed by a user. For example, when the user resumes a course or courses after the point at which it was stopped, the status of the course is updated.\
> \
> The endpoint for \*\*Update Course State\*\* is \`/update\`\
> \
> The fields marked with an asterisk (\*) are mandatory. They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Course Progress APIs","version":"1.0"},"tags":[{"name":"Course Progress API(s)","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api","variables":{}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"UpdateContentStateRequest":{"title":"UpdateContentStateRequest","required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/Request1"}}},"Request1":{"title":"Request1","required":["userId","contents"],"type":"object","properties":{"userId":{"type":"string","description":"This ID uniquely identifies a user"},"contents":{"type":"array","items":{"$ref":"#/components/schemas/Content"},"description":"This represents the array of the contents which comprises of various parameters related to the content"},"assessments":{"description":"This represents the array of the assessments which comprises of various parameters related to assessments","type":"array","items":{"$ref":"#/components/schemas/Assessment"}}}},"Content":{"title":"Content","required":["contentId","batchId","status","courseId","lastAccessTime"],"type":"object","properties":{"contentId":{"type":"string","description":"The identifier of content status need to update"},"batchId":{"type":"string","description":"Identifier of the batch, for user enrolled"},"status":{"type":"integer","format":"int32","description":"This represents the user content consumption status. For reference: Example 0 - not started, 1- in progress, 2- completed"},"courseId":{"type":"string","description":"Identifier of the course"},"lastAccessTime":{"type":"string","description":"Represents when was the the course content last accessed"}}},"Assessment":{"title":"Assessment","type":"object","properties":{"assessmentTs":{"description":"Assessment time in epoch","type":"string"},"batchId":{"description":"This ID uniquely identifies a batch","type":"string"},"courseId":{"description":"This ID uniquely identifies the course","type":"string"},"userId":{"description":"This ID uniquely identifies a user","type":"string"},"attemptId":{"description":"This ID uniquely identifies the attempt","type":"string"},"contentId":{"description":"This ID uniquely identifies the content","type":"string"},"events":{"description":"This will have the assess events of the telemetry","type":"array","items":{}}}},"UpdateContentState-200OK-Success":{"title":"UpdateContentState-200OK-Success","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/Params"},"responseCode":{"type":"string"},"result":{"$ref":"#/components/schemas/Result1"}}},"Params":{"title":"Params","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string","nullable":true}}},"Result1":{"title":"Result1","required":["do_11259843042561228816"],"type":"object","properties":{"do_11259843042561228816":{"type":"string"}}},"UpdateContentState-500InternalServerError":{"title":"UpdateContentState-500InternalServerError","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/Params2"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"Params2":{"title":"Params2","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string","nullable":true},"err":{"type":"string"},"status":{"type":"string"},"errmsg":{"type":"string"}}}}},"paths":{"/course/v1/content/state/update":{"patch":{"tags":["Course Progress API(s)"],"summary":"Update Content State","description":"This API is used to update the Course(content) state as consumed by a user. For example, when the user resumes a course or courses after the point at which it was stopped, the status of the course is updated.\n\nThe endpoint for **Update Course State** is `/update`\n\nThe fields marked with an asterisk (*) are mandatory. They cannot be null or empty.","operationId":"UpdateContentState","parameters":[{"name":"Content-Type","in":"header","description":"The Content Type entity is the media type of the resource. Possible media types can be:- \n  - application/json","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization\nkey. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"'The registered user token/key to authenticate user and execute\nthe API.'","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"Represents the body and formdata parameters of the course progress state API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContentStateRequest"}}},"required":true},"responses":{"200":{"description":"SUCCESS. The \"Update Course State\" operation was successful!","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContentState-200OK-Success"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContentState-500InternalServerError"}}}}},"deprecated":false}}}}
```

#### Course Batch Certificates APIs are listed below:

{% openapi src="/files/xcUPf5R9tbRhWNGj7r1A" path="/course/batch/cert/v1/template/add" method="patch" %}
[coursebatchcertificateapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2Fgit-blob-a97935c7b6a2eb6e9963ee252e91b43391d7a858%2Fcoursebatchcertificateapi.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/1gVQ1dxBpo8NhMFp8wwj" path="/course/batch/cert/v1/template/remove" method="patch" %}
[coursebatchcertificateapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2Fgit-blob-a97935c7b6a2eb6e9963ee252e91b43391d7a858%2Fcoursebatchcertificateapi.yaml?alt=media)
{% endopenapi %}

#### Group Activity Aggregator

## Group Activity Aggregator

> This API is used for reading the current progress of the course (content) consumed by group members. For example, the mentor/user can view and check the progress of a specific activity.\
> \
> \- The endpoint for \*\*Group Activity Aggregator\*\* is \`/agg\`\
> \
> \- The fields marked with an asterisk (\*) are mandatory.\
> They cannot be null or empty.

```json
{"openapi":"3.0.1","info":{"title":"Group Activity Apis","version":"1.0"},"tags":[{"name":"Group Activity Apis","description":""}],"servers":[{"url":"https://staging.open-sunbird.org/api"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"groupactivityapiGroupActivityAggRequest":{"title":"GroupActivityAggRequest","required":["request"],"type":"object","properties":{"request":{"$ref":"#/components/schemas/groupactivityapiRequest"}}},"groupactivityapiRequest":{"title":"Request","required":["groupId","activityId","activityType"],"type":"object","properties":{"groupId":{"type":"string"},"activityId":{"type":"string"},"activityType":{"type":"string"}}},"groupactivityapiGroupActivityAgg-withinvalidactivity-d":{"title":"GroupActivityAgg-withinvalidactivity-d","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/groupactivityapigroupactivityapiParams"},"responseCode":{"type":"string"},"result":{"$ref":"#/components/schemas/groupactivityapigroupactivityapiResult"}}},"groupactivityapigroupactivityapiParams":{"title":"Params","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string","nullable":true}}},"groupactivityapigroupactivityapiResult":{"title":"Result","required":["activity","groupId","members"],"type":"object","properties":{"activity":{"$ref":"#/components/schemas/groupactivityapiActivity"},"groupId":{"type":"string"},"members":{"type":"array","items":{"type":"string"},"description":""}}},"groupactivityapiActivity":{"title":"Activity","required":["id","type","agg"],"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"agg":{"type":"array","items":{"$ref":"#/components/schemas/groupactivityapiAgg"},"description":""}}},"groupactivityapiAgg":{"title":"Agg","required":["metric","lastUpdatedOn","value"],"type":"object","properties":{"metric":{"type":"string"},"lastUpdatedOn":{"type":"integer","format":"int64"},"value":{"type":"integer","format":"int32"}}},"groupactivityapiGroupActivityAgg-Errorwhilefetchinggroupmembersrecord":{"title":"GroupActivityAgg-Errorwhilefetchinggroupmembersrecord","required":["id","ver","ts","params","responseCode","result"],"type":"object","properties":{"id":{"type":"string"},"ver":{"type":"string"},"ts":{"type":"string"},"params":{"$ref":"#/components/schemas/groupactivityapigroupactivityapiParams1"},"responseCode":{"type":"string"},"result":{"type":"object"}}},"groupactivityapigroupactivityapiParams1":{"title":"Params1","required":["resmsgid","msgid","err","status","errmsg"],"type":"object","properties":{"resmsgid":{"type":"string","nullable":true},"msgid":{"type":"string"},"err":{"type":"string","nullable":true},"status":{"type":"string"},"errmsg":{"type":"string"}}}}},"paths":{"/data/v1/group/activity/agg":{"post":{"tags":["Group Activity Apis"],"summary":"Group Activity Aggregator","description":"This API is used for reading the current progress of the course (content) consumed by group members. For example, the mentor/user can view and check the progress of a specific activity.\n\n- The endpoint for **Group Activity Aggregator** is `/agg`\n\n- The fields marked with an asterisk (*) are mandatory.\nThey cannot be null or empty.","operationId":"GroupActivityAgg","parameters":[{"name":"Content-Type","in":"header","description":"'The Content Type entity is the media type of the resource.Possible\\\n\\ media types can be:- \\n  - application/json'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"x-authenticated-user-token","in":"header","description":"'The registered user token/key to authenticate user and execute\nthe API.'","required":true,"style":"simple","schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"'To make use of the API, you require authorization. Raise a request\nto the administrator for the use of the API. You will receive the authorization\nkey. Specify the key received, here.'","required":true,"style":"simple","schema":{"type":"string"}}],"requestBody":{"description":"Represents the body and formdata parameters of the Group Activity Aggregator API","content":{"application/json":{"schema":{"$ref":"#/components/schemas/groupactivityapiGroupActivityAggRequest"}}},"required":true},"responses":{"200":{"description":"SUCCESS. The \"Group Activity Aggregator\" operation was successful!","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/groupactivityapiGroupActivityAgg-withinvalidactivity-d"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/groupactivityapiGroupActivityAgg-Errorwhilefetchinggroupmembersrecord"}}}}},"deprecated":false}}}}
```

#### Collection Summary

## Collection Summary(<https://staging.open-sunbird.org/report/v1/collection/summary>)

<mark style="color:green;">`POST`</mark>&#x20;

This API gives the collection summary, like the total number of enrolments, completion count, count of certificates issued.

#### Request Body

| Name                                           | Type         | Description                                                                                                             |
| ---------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
| request<mark style="color:red;">\*</mark>      | Object       |                                                                                                                         |
| filters<mark style="color:red;">\*</mark>      | Object       | Search filters                                                                                                          |
| collectionId<mark style="color:red;">\*</mark> | String       | Id of the collection                                                                                                    |
| batchId<mark style="color:red;">\*</mark>      | String       | Id of the batch                                                                                                         |
| group\_by                                      | String Array | `"state", "dist"`                                                                                                       |
| intervals                                      | String       | `2019-09-23T00:00:00.000Z/2019-09-24T00:00:00.000Z"` St`artDate - Batch Start Date and  Default EndDate - Current Date` |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "result": {
    "collectionId": "", // Collection/CourseId
    "name": "", // Collection Name
    "batchId": "", // Batch Identifier
    "enrolmentCount": "",
    "completionCount": "",
    "certificatesIssuedCount": "",
    "summary": {  // Summary by state and district level
      "state": {
        "enrolmentCount": "",
        "completionCount": ""
      },
      "district": {
        "enrolmentCount": "",
        "completionCount": ""
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### Page APIs

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/create" method="post" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/update" method="patch" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/read/{pageName}" method="get" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/section/create" method="post" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/section/update" method="patch" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/section/read/{SectionId}" method="get" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/wmsMnDwSDm4D9Itlvwus" path="/data/v1/page/section/list" method="get" %}
[pagesapi.yaml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FZkfIJ75jz4eVsoUyZEWY%2Fpagesapi.yaml?alt=media\&token=c34e1692-7bac-4b8e-88f7-ea9d3b92c726)
{% endopenapi %}

{% openapi src="/files/TelWJNdJU9U9ETaIBjpC" path="/api/course/v1/jobrequest/submit" method="post" %}
[proxy-result.yml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FNuEgzIbfrbSD5rPc8L7R%2Fproxy-result.yml?alt=media\&token=e893b953-6f4a-4e25-b896-07039d5c721d)
{% endopenapi %}

{% openapi src="/files/TelWJNdJU9U9ETaIBjpC" path="/api/course/v1/jobrequest/list/{tag}" method="get" %}
[proxy-result.yml](https://308610995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4ZKyfmmhMWpPkD6iYvKF%2Fuploads%2FNuEgzIbfrbSD5rPc8L7R%2Fproxy-result.yml?alt=media\&token=e893b953-6f4a-4e25-b896-07039d5c721d)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lern.sunbird.org/use/developer-guide/lms-service/apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
