Skip to main content
View as Markdown

Certificates - Gamification

Certificates​

Certificates issue PDF credentials to users who complete required activities. They use the same rules engine as badges, with added PDF generation configuration.

8.1 Certificate Entity​

FieldTypeDescription
namestringCertificate name
descriptionstringDescription (supports HTML)
statusstringenabled or disabled
externalIdstringExternal reference (e.g., NASBA program ID)
certificateEligibilitystringonce (one per user) or perEntry (one per user per entry)
certifiedCreditsThresholdnumberCredits required to earn the certificate
hoststringEvents site URL for certificate page links
outputFileConfigurationobjectPDF template configuration (see below)
creditsMappingstringMaps rules to credit values
participationPolicyobjectControls user visibility

8.2 PDF Template (outputFileConfiguration)​

The first element is a background image URL. Subsequent elements are text overlays with positioning.

Text element types: entryName, userFullName, credits, certificationDate

curl -X POST "$KALTURA_SCM_URL/certificate/create" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"name": "CPE Certificate",
"description": "Continuing Professional Education",
"status": "disabled",
"participationPolicy": {"userDefaultPolicy": "display", "policies": []},
"externalId": "PROGRAM-12345",
"certificateEligibility": "once",
"certifiedCreditsThreshold": 3,
"host": "https://mysite.events.kaltura.com",
"outputFileConfiguration": {
"outputFileElements": [
{"url": "https://cfvod.kaltura.com/p/'$PARTNER_ID'/thumbnail/entry_id/'$BG_ENTRY_ID'/width/1397/height/1080"},
{"textElementType": "userFullName", "fontSize": 30, "y": 440},
{"textElementType": "entryName", "fontSize": 30, "y": 570},
{"textElementType": "credits", "fontSize": 23, "x": 1060, "y": 699},
{"textElementType": "certificationDate", "fontSize": 18, "x": 695, "y": 636}
]
}
}'

8.3 Credits Mapping​

Maps rules to credit values using a newline-delimited format:

credits,<ruleId>
<credits_value>,<threshold>
<credits_value>,<threshold>
curl -X POST "$KALTURA_SCM_URL/certificate/update" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"id": "'$CERT_ID'",
"status": "enabled",
"creditsMapping": "credits,'$RULE_ID'\n10.0,1\n11.5,2"
}'

8.4 Certificate Rules​

Create rules for certificates via the standard rule/create endpoint with gameObjectType: "certificate":

curl -X POST "$KALTURA_SCM_URL/rule/create" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"gameObjectType": "certificate",
"gameObjectId": "'$CERT_ID'",
"name": "Watch session",
"conditions": [{"fact": "eventType", "operator": "equal", "value": "viewPeriod"}],
"type": "sum",
"mode": "distribute_points",
"metric": "playTime",
"groupBy": "kuserId,entryId",
"goal": "60",
"points": "1",
"maxPoints": "unlimited",
"reportFormat": "default"
}'

8.5 User Certificate Progress​

curl -X POST "$KALTURA_SCM_URL/userCertificateReport/list" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"gameObjectId": "'$CERT_ID'", "pager": {"pageSize": 100, "pageIndex": 1}}'