Certificates Creation and Configuration
Last updated
Last updated
API Used: {{host}}/api/asset/v1/create {{host}}/api/asset/v1/upload {{host}}/api/asset/v1/update {{host}}/api/course/batch/cert/v1/template/add {{host}}/api/course/batch/cert/v1/template/remove http://docs.sunbird.org/latest/apis/assetapi/ http://docs.sunbird.org/latest/apis/coursebatchcertificateapi/index.html http://docs.sunbird.org/latest/apis/coursebatchmanapi/ Introduction: In Sunbird, a ‘Certificate’ can be attached to any course/batch, which will then be issued to a user on completion of the course/batch. The ‘certificate’ workflow in Sunbird involves creating certificate template(s) or template layout(s) and attaching them with the course batch so that a certificate gets issued based on the template selected. Certificates in Sunbird have the following features. a. Certificate can be attached to a specific Course Batch. b. Certificate templates can be configured from the back end for a specific tenant. c. Once configured(as in #b), the Course creator/mentor can attach a certificate to a batch via the option available in the portal. d. Rules for issuing certificates can be configured via the option available in the portal. e. Sunbird allows you to create both “certificate template layout” and “Certificate. Certificate Templates: In order to attach a certificate to any course batch, ‘certificate templates’ need to be created / present in the system for that particular channel. Certificate templates are basically a model of the actual certificate which consists of specific designs and variables.
Certificates can be configured for a tenant in two ways: a) Configure generic “cert template layout” b) Configure “cert template” Certificate Template Layout “Cert template layout” is an SVG file with placeholders for logo and signature image along with other variables - course name, user’s name and date of issue. Once configured, this SVG file becomes a layout for creating multiple “cert template” by adding logos and signature images in the placeholders via the Sunbird portal(at the time of Creating the Batch for a course).
Once the “cert templates” are generated using layouts, “cert templates” can be attached to course batches and the certificate will be generated as per the chosen templates. We have four types of “cert template layout” available for Sunbird currently,
SVG file with a placeholder for 1 logo and 1 signature image
SVG file with a placeholder for 2 logos and 1 signature image
SVG file with a placeholder for 1 logo and 2 signature images
SVG file with a placeholder for 2 logos and 2 signature images
Certificate Template: “Cert template” is an SVG file which doesn't have any placeholders (like Logo and Signatures as in the case of Certificate Template Layout) for template modifications. It is a fixed template (with variables for course name, user’s name and date of issue). These can be generated using “cert template layout” via application or created directly using certificate APIs. Once created it can be directly attached to course batches. In the Sunbird context, each certificate template is an asset and has the below attributes:
Certificate Creation Workflow in Sunbird: As mentioned in the previous sections, the Certificate Template Creation request can be, to create either a “Certificate Template” or “Certificate Template Layout”
Steps to Configure a “cert template layout”
Configure or validate the certificate rule preference for the tenant.
Create an asset with certType as a ‘cert template layout’ for the tenant.
Upload the “cert template layout” SVG file to that asset.
“cert template” can be created by a course creator in the application using one of the layouts and then the same can be attached to a course-batch
The following diagram explains the certificate template layout creation process:
APIs and Steps to Create Certificate Templates Layout:
Property | Description | Eg. |
---|---|---|
certType
certType represents the type of the certificate.Following are the two available types: template"
cert template layout
cert template
"certType": "cert template. "certType": "cert template layout"
code
Represents the code value of asset
"code": "CertificateOfCompletion"
channel
Represents the channel value of the asset to which it belongs
"channel":"0126825293972439041"
name
Represents the name of the certificate asset
"name": "Certificate of Completion"
identifier
Represents the unique id of the certificate asset
"identifier": "do_21341213974781952 01161"
mimeType
Represents the mime type of the asset, i.e.,‘image/svg+xml’ in case of certificates
"mimeType":"image/svg+xml"
license
Represents the licensing of the certificate asset
"license": "CC BY 4.0"
primaryCategory
Represents the primary category of the asset
"primaryCategory": "Certificate Template"
mediaType
Represents media type of asset, i.e., ‘image’ in case of certificates
"mediaType": "image"
issuer
Represents the details about certificate issuing organisations. It can be a state or non-state tenant.
"issuer": {"name": "mp","url": "https://Sunbird.gov. in/mp/"}
signatory list
Represents the details about the signatory authority
"issuer": { "name": "/name of signatory/", "image": "/base64 encoded png image of signature/", "id": "/id of signatory/", "designation": "/designation of signatory/" } "
Certificate Template Layout, where the user can change the logo, signature etc.. via UI(ie. Portal interface)
Certificate Template, where the user cannot change any parameters via UI(ie. Portal Interface)